How to know if powershell is installed on remote workstation?

Darktux picture Darktux · Jan 25, 2013 · Viewed 22.3k times · Source

How to know if powershell is installed on remote workstation; we need to do the inventory of all the powershell enabled workstations so that we can plan a change for deploying; is there a way to remotely know if powershell is installed and what version?

Answer

Loïc MICHEL picture Loïc MICHEL · Jan 25, 2013

check if file exist ?

$path= "\\remote\C$\windows\System32\WindowsPowerShell\v1.0\powershell.exe"
if(test-path $path){(ls $path).VersionInfo}