I have a script I use to install .msi packages, and have been trying to tweak it so I can install standalone .msu packages. Here's what I have:
$computers = Get-Content 'C:\Folder\Computerlist.txt' $process = 'Windows6.1-KBxxxxxxx-x64.msu' $arglist = '/quiet /norestart' foreach ($computer in $computers){ Write-Host "Processing computer: $computer" -ForegroundColor green $SB={ Start-Process -FilePath 'wusa.exe' -ArgumentList "c:\Temp\$using:process $using:arglist" -Wait -ErrorAction Stop -PassThru } Invoke-Command -AsJob -ComputerName $computer -ScriptBlock $SB } Start-Sleep -Seconds 3 Get-Job | Receive-Job -Keep | Format-Table PSComputerName, ProcessName, ID -AutoSize -Wrap
The problem is that the process starts and stops almost immediately on the remote computer, it does not actually install the package. If I open cmd and type:
wusa.exe c:\temp\Windows6.1-KBxxxxxxx-x64.msu /quiet /norestart
then the package installs properly, I can watch the wusa.exe process in task manager, it takes about a minute. However, my powershell script causes the wusa.exe process to start and run for about 2 seconds and closes.