Reputation: 1306
I understand how to use PowerShell to install/uninstall locally, but how can I run this on another server that is on the same network and same OS version?
$product = Get-WmiObject -Class Win32_Product -Filter "Name='MyMSI'"
$product.Uninstall()
or
$product = Get-WmiObject -List | ?{ $_.Name -eq "Win32_Product" }
$product.Install("C:\\MyMSI.msi")
Upvotes: 2
Views: 4352
Reputation: 2368
You can still use those lines to uninstall and install software by using the -ComputerName property and specifying the name of the computer. For the install you have to copy the software to the local filesystem and specify that in the command.
Upvotes: 1