2016-05-20 33 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