Find all MSI files and install them from a directory

1
2
3
4
$Path = Get-ChildItem -Path C:\Windows\CCMCache -Recurse -Filter *.MSI
ForEach ( $Installer in ( Get-ChildItem -Path $Path.DirectoryName -Filter *.MSI ) ) {
    Start-Process -Wait -FilePath C:\windows\system32\msiexec.exe -ArgumentList "/i $Installer.FullName /passive /norestart"
    }

If you found this article helpful, would you consider buying me a Coffee?