2016-05-20 67 views
1

從UNIX的Windows執行電源外殼我試圖通過ssh來觸發位於從UNIX的Windows服務器上的PowerShell腳本錯誤而通過ssh

SSH命令:

ssh -o StrictHostKeyChecking=no [email protected] "powershell "D:\\Script\\file\\location\\test.ps1" source_file target_file" 

Powershell的測試腳本:

param([string]$inputFile, [string]$outputFile) 
Write-Host "INPUT: " $inputFile 
Write-Host "OUTPUT: " $outputFile 
Exit 

但是,一旦powershell完成執行,控件不會返回到unix提示符。 請建議。

回答

0

試一下

ssh -o StrictHostKeyChecking=no [email protected] "echo '\n' | powershell 'D:\\Script\\file\\location\\test.ps1' source_file target_file" 
+0

謝謝,糾正了 – Eugene