MSDeployコマンドのpreSync呼び出し中にPowerShellを呼び出そうとしていますが、PowerShellは呼び出された後にプロセスを終了しません。コマンド(コマンドラインから): "tools / MSDeploy / msdeploy.exe" -verb:sync -preSync:runCommand = "powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command C:/MyInstallPath/deploy.ps1 Set -WebAppOffline Uninstall-Service "、waitInterval = 60000 -usechecksum -source:dirPath =" build / for-deployment "-dest:wmsvc = BLUEPRINT-X86、username = deployer、password = deployer、dirPath = C:/ MyInstallPath
ここで、PowerShellプロセスを取得して強制終了するハック(http://therightstuff.de/2010/02/06/How-We-Practice-Continuous-Integration-And-Deployment-With-MSDeploy.aspx )を使用しましたが、動作しませんでした。taskkillと同等のsysinternalsも試しましたが、MSDeployがエラーになるように、プロセスを強制終了するものはありません。コマンドが実行されますが、そこに座っているだけです。PowerShellがこのようにハングする原因となる可能性のあるアイデアはありますか?私はウェブ上で他のいくつかの同様の問題を見つけましたが、答えはありません。
環境は、Powershell2.0を使用するWin2K3です。
更新:これは、PowerShellコマンドを呼び出すために使用する.vbsスクリプトです。'cscript.exe path / to/script.vbs'を使用して呼び出します。
Option Explicit
Dim oShell, appCmd,oShellExec
Set oShell = CreateObject("WScript.Shell")
appCmd = "powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ""&{ . c:/development/materialstesting/deploy/web/deploy.ps1; Set-WebAppOffline }"" "
Set oShellExec = oShell.Exec(appCmd)
oShellExec.StdIn.Close()