$LocalPath = 'C:\MSUpdates' $MSUpdates = @(Get-ChildItem –Path $LocalPath -Filter '*.msu') if ($MSUpdates.Count -ge 1) { $MSUpdates | % { Write-Host "Installing Microsoft Update: $($_.Name)" & Start-Process -FilePath “wusa.exe” -ArgumentList "$($_.Name) /quiet /norestart" -Wait } } else { Write-Host 'No updates found!' }
Screenshot in ISE