如何知道PowerShell是否安装在远程工作站上?

Dar*_*tux 7 powershell installation remote-desktop

如何知道PowerShell是否安装在远程工作站上 ; 我们需要对所有支持PowerShell的工作站进行清点,以便我们可以规划部署的更改; 有没有办法远程知道PowerShell是否已安装以及版本是什么?

Loï*_*HEL 4

检查文件是否存在?

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