How to check if powershell is installed?
Posted: 26 Sep 2013 14:17
Hello everyone...
I am asking a rather simple question but I can't get my code to work with it.
How do I check if powershell is installed?
I have tried...
But I could probably get that to work using the correct directories.
But I don't want to have messy code with the following directories saying v1.0, v2.0 etc and x86, x64 version directories.
How can I solve this with a few lines of code?
BTW I need this, because if powershell is not installed my script would shout out an error and rather run on wget to the my job..
Thanks. Hope you can help
I am asking a rather simple question but I can't get my code to work with it.
How do I check if powershell is installed?
I have tried...
Code: Select all
if exist "powershell.exe" (echo Exist ) else (echo Sorry mate )
pause
But I could probably get that to work using the correct directories.
But I don't want to have messy code with the following directories saying v1.0, v2.0 etc and x86, x64 version directories.
How can I solve this with a few lines of code?
BTW I need this, because if powershell is not installed my script would shout out an error and rather run on wget to the my job..
Thanks. Hope you can help