Tuesday, December 9, 2008

Who needs SMS!!

Install an .MSI package via WMI


(Get-WMIObject -ComputerName $TargetSys -list | Where-Object -FilterScript {$_.Name -eq "Win32_Product"}).PSBase.InvokeMethod("Install","\\AppSrv\dsp\NewPackage.msi")


May the PoSH Be with you,
Powershell Jedi

5 comments:

Hal said...

This will be much more efficient:

([wmiclass]'\\$computer\root\cimv2:win32_product').Install($msi)

Powershell Jedi said...

Man, your such a big help, I think I'm going to call you Yoda, LOL!!

98cwitr said...
This comment has been removed by the author.
98cwitr said...
This comment has been removed by the author.
98cwitr said...

$a=([wmiclass]"\\$computer\root\cimv2:win32_product").Install($msi)}