Uninstalling a remote application not working

Hi, Guys.

I’m having trouble getting a remote application to uninstall from a server. I’ve looked at a couple different ways of doing this, but I don’t want to use Win32_Product. Which leaves me with the Get-Package and Uninstall-Package cmdlet’s. Neither of which work. Here is what I’ve tried:


invoke-command -computername Server1 -scriptblock {(Get-Package -Name "WinMerge*" | Uninstall-package)}


invoke-command -computername Server1 -scriptblock {Uninstall-Package -InputObject (Get-Package -Name 'WinMerge' -AllVersions -Force)}


invoke-command -computername Server1 -scriptblock {Get-Package -Name "WinMerge" | Uninstall-Package}


invoke-command -computername Server1 -scriptblock {get-package *WinMerge* |% { & $_.Meta.Attributes["UninstallString"]}}

Attempts 1-3 appear to run, but the application remains. Attempt 4 runs but errors with:

The term ‘“C:\Program Files (x86)\WinMerge\unins000.exe”’ is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
+ CategoryInfo : ObjectNotFound: (“C:\Program Fil…e\unins000.exe”:String) , CommandNotFo
+ FullyQualifiedErrorId : CommandNotFoundException
+ PSComputerName : Server1

What am I doing wrong here?

I just tried all of these on the local server, rather than running with an Invoke-Command, and they still don’t work. I even tried a different application to uninstall as well with the same results.

Are these even valid cmdlet’s anymore?

I’d make sure I have the correct uninstall string and simply use it.

Do you have an “unins000.exe” in the path “C:\Program Files (x86)\WinMerge”? And are you sure you don’t need to pass a parameter for silent/unattended de-installation?

Yes, that uninstall exe is in the path, and it doesn’t accept any silent uninstall params that I can find. Again, all the attempts fail both locally and remotely.

How did you search for it? I’d run it with the parameter /? or -h or --help or something like this.

So you cannot uninstall the app unsing the pure uninstall string in an elevated console? Really? :thinking:


According to this site:

The uninstall executable can take the switches /VERYSILENT /NORESTART for a silent uninstall.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.