I try to install .msu package using Poweshell. My code:
$Args = @(('"' + $Path_Temp + '\' + $Hotfix[1] + '.msu' + '"'), '/norestart')
echo $Args
Start-Process -FilePath ($Env:SystemRoot + '\System32\wusa.exe') -ArgumentList $Args -Verb RunAs -Wait
echo
outputs this:
"C:\Users\MyUser\AppData\Local\Temp\Windows6.1-KB2758857-x64.msu"
/norestart
All looks good, but in the end wusa
warns me about incorrect usage. It works well when I pass only the first argument (which is the path to .msu file) to ArgumentList
. My code does not work when I pass multiple arguments, why? I use Powershell v5.1.14409.1005