有人可以帮我在不重启服务器的情况下使用powershell脚本在多台服务器上安装或升级powershell v5 .
我在我的脚本中使用了以下命令,它抛出了错误 .
Start-Process -Path \\"$computer"\"$path1"” -ArgumentList “/closeprograms”, “/passive”, “update-no”, /norestart” -Wait
Start-Process : This command cannot be run due to the error: The system cannot find the file specified.
At C:\Users\Joy\Desktop\Joy\update.ps1:21 char:3
+ Start-Process \\"$computer\$path1"” -ArgumentList “/closeprograms”, “/passive” ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
1 回答
基于评论,您似乎指向错误
但是,如果您尝试在不同的服务器上运行,那么除非此文件位于此位置以用于您不会更新的所有服务器,否则如果您的SAN上有他们调用的文件可以访问,请指向并运行 .