Start-Process在本地計算機上啟動進程(參考https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/start-process?view=powershell-5.1)。您可以嘗試使用會話(New-PSSesssion或Enter-PSSession)在遠程計算機上運行進程,因此看起來像這樣(未測試,我更喜歡檢查連接等): foreach($server in $servers) { $session = (New-PSSession $server) #two approaches - change remote path to local path #for sake of invocing command or stay with the remote path #as the machine should work with it $sb = { param ( [string] $path ) $args = @("/install", "/quiet", "/norestart") $p = (Start-Process -FilePath $path -ArgumentList $args -Wait) if ($p -eq 0) { Write-H