2016-05-20 37 views
1
ssh Ausführung

Ich versuche, Powershell-Skript zu triggern auf Windows-Server von Unix durch ssh mit WohnsitzFehler beim Power-Shell auf Windows von UNIX durch

SSH-Befehl:

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

Powershell Testskript:

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

Sobald die Powershell die Ausführung jedoch beendet, kehrt das Steuerelement nicht zurück zur Unix-Eingabeaufforderung zurück. Bitte vorschlagen.

Antwort

0

Versuchen Sie, dass

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

Danke, korrigiert, dass – Eugene

Verwandte Themen