Else

The term 'else' is not recognized as the name of a cmdlet, function, script file
, or operable program. Check the spelling of the name, or if a path was included
, verify that the path is correct and try again.

The above error message kills me, but the script works, can someone help me

July 22nd, 2015 8:31am

You'll need to post your script or we can't do anything to help you.
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2015 8:34am

The term powershell admin is used loosely these days. You'll have to post your code, you most likely are missing a bracket somewhere.  
July 22nd, 2015 8:34am

Probably just a little syntax issue in your script. Can you paste it here?
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2015 8:35am

did u see that my script works? how on earth it will work if we miss brackets, grow up sir, dont use unnecessary words
July 22nd, 2015 8:56am

did u see that my script works? how on earth it will work if we miss brackets, grow up sir, dont use unnecessary words

It is highly unlikely that your script actually works if you're getting this error.

Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2015 8:59am

This is illegal:

if($true){'good'}
else{'bad'}

Has to be like this:

if($true){'good'
}else{'bad'}

preferred:

if($true){
    'good'
}else{
    'bad'
}

July 22nd, 2015 9:00am

It's easily done:

if ($poster -eq 'rude') {
}
"oh noes"
else {
"failed again"
}

else : The term 'else' is not recognized as the name of a cmdlet, function, script file, or operable program.
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2015 9:03am

that was basically a start service script and it started it , so it works. i figured it out, there was some space above the else once i remove that it stops throwing error
July 22nd, 2015 9:06am

that was basically a start service script and it started it , so it works. i figured it out, there was some space above the else once i remove that it stops throwing error

Not funny.
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2015 10:17am

that was basically a start service script and it started it , so it works. i figured it out, there was some space above the else once i remove that it stops throwing error
July 22nd, 2015 1:04pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics