0
我有一個Windows Azure啓動任務,我試圖運行安裝MSI。我正嘗試通過PowerShell腳本運行任務。我可以證實,PowerShell腳本時,我有以下的運行:Windows Azure - 安裝MSI會導致掛斷?
"Before powershell" >> C:\hello.txt
$msi = "E:\approot\bin\StartupScripts\AppInitalization_x64.msi"
if($true -eq [System.IO.File]::Exists($msi))
{
"file exists" >> C:\hello.txt
}
else
{
"file does not exist" >> C:\hello.txt
}
"After powershell" >> C:\hello.txt
如果我運行部署,我hello.txt
包含「之前,文件存在」和「之後」。
但是,如果我試圖改變該文件存在,條件是:
$arguments= ' /qn /l*v C:\AppInitalization_x64.txt'
Start-Process `
-file $msi `
-arg $arguments `
-passthru
部署掛起(我已經讓它等待長達5小時)。 如果我遠程進入機器並嘗試相同的PowerShell片段,它安裝得很好。
任何想法,爲什麼它會掛起,當我有這是啓動腳本的一部分?
AppInitialization_x64.txt不會被創建。事件日誌中也沒有提示安裝程序已啓動。 – Kyle
我認爲你正在查看應用程序事件日誌,Windows Installer消息將被記錄在哪裏?嗯。你可以記錄哪個用戶帳戶的任務執行?例如。 'Out-File user.txt -In $ env:username' –