# Tome's Land of IT

IT Notes from the Powertoe – Tome Tanasovski

## Powerbits #5 Installing an MSI via WinRM (Remoting) with PowerShell

I had to look this one up today so I thought it was time I added it to the site as a Powerbit.  There are many ways to execute an msi remotely with PowerShell.  I find myself needing to remember how exactly to do this via WinRM on occassion. This is the technique I use to push out an msi installation in my labs.

$script = { #do preinstall stuff$args = "-i c:\path\to\msi\file.msi /qn /norestart"
[diagnostics.process]::start("msiexec.exe", $args).WaitForExit() #do follow up stuff } invoke-command -computername (gc computerlist.txt) -scriptblock$script

You can also use WMI or schtasks to execute an MSI remotely, but that’s so last decade 🙂