Is PowerShell Available?

by Sep 10, 2009

As PowerShell becomes more important, you may want to automatically check whether it is available on a machine. To determine whether any PowerShell version is available, check whether this key is available: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1

You could do that from within PowerShell, too, but you won't be able to run it if PowerShell isn't available:

Test-Path registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1

Twitter This Tip! ReTweet this Tip!