2

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")

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

1

You must use PowerShell remoting.

Read this please

1 Comment

'Get-Package -ProviderName Programs -IncludeWindowsInstaller -Name appname*|Uninstall-Package -Force -Verbose -ErrorAction Continue -WarningAction Continue -InformationAction Continue -AllVersions -Confirm -Debug' //// No matter what I do, I cannot get this to work Uninstalling postgres remotely... I even re-authenticated with specific creds and it's STILL there. Any ideas???

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.