Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Install MSP files

$
0
0

Normal 0 false false false EN-US X-NONE HE

hi i am trying to install multiple MSP files in powershell  array

 and i am missing sumthing

$updates = Get-ChildItem -Path C:\temp | select -ExpandProperty name

foreach ($up in $updates)
{
        {
        $file = "C:\temp\$up"
        $silentArgs = "/passive"
        $additionalInstallArgs = ""
        Write-Debug "Running msiexec.exe /update $file $silentArgs"
        $msiArgs = "/passive`"$file`""
        $msiArgs = "$msiArgs $silentArgs $additionalInstallArgs"
        Start-Process -FilePath msiexec -ArgumentList $msiArgs -Wait
        }
}

Normal 0 false false false EN-US X-NONE HE

When I am running this on a single file it will run and do the install

Normal 0 false false false EN-US X-NONE HE

But when I am running the loop it will loop until the last file without installing any one of them

thanks daniel

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles