リモート サーバーで PowerShell スクリプトを実行するために MSDeploy を取得しようとしています。これは私がMSDeployを実行する方法です:
msdeploy \
-verb:sync \
-source:runCommand='C:\temp\HelloWorld.bat', \
waitInterval=15000,waitAttempts=1 \
-dest:auto,computername=$WebDeployService$Credentials -verbose
HelloWorld.bat には以下が含まれます。
echo "Hello world!"
powershell.exe C:\temp\WebDeploy\Package\HelloWorld.ps1
echo "Done"
HelloWorld.ps1 には以下のみが含まれます。
Write-Host "Hello world from PowerShell!"
ただし、PowerShell は決して終了しないようです。これは、msdeploy を実行した結果の出力です。
Verbose: Performing synchronization pass #1.
Verbose: Source runCommand (C:\temp\HelloWorld.bat) does not match destination (C:\temp\HelloWorld.bat) differing in attributes (isSource['True','False']). Update pending.
Info: Updating runCommand (C:\temp\HelloWorld.bat).
Info:
Info: C:\temp>echo "Hello world!"
"Hello world!"
C:\temp\WebDeploy>powershell.exe C:\temp\HelloWorld.ps1
Info: Hello world from Powershell!
Info:
Warning: The process 'C:\Windows\system32\cmd.exe' (command line '/c "C:\Users\peter\AppData\Local\Temp\gaskgh55.b2q.bat
"') is still running. Waiting for 15000 ms (attempt 1 of 1).
Error: The process 'C:\Windows\system32\cmd.exe' (command line '/c "C:\Users\peter\AppData\Local\Temp\gaskgh55.b2q.bat"'
) was terminated because it exceeded the wait time.
Error count: 1.
誰でも解決策を知っていますか?