Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

uninstall program on remote machine -

$
0
0

All,

I am trying to uninstall an application on a WYSE 32bit Windows Embedded device.  I am unable to use WIn32_product and have to Win32Reg_AddRemovePrograms.  I can query the device remotely fine with the following command

PS C:\> get-wmiobject -Class Win32Reg_AddRemovePrograms -ComputerName rob_wyse | where {$_.Displayname -like "blah*"} | select ProdID | fw

{548B747B-9B82-4FA7-91C8-15C8E8B053B1}

My issue is I want to capture the output of the ProdID into a variable and then use invoke-command to call MsiExec to uninstall the program.  Below is what I have thus far..I was trying to use
the "outVariable" with hopes that I could use Invoke-Command -ComputerName rob_wyse "MsiExec.exe /norestart /q/x '$prid'" to run the uninstall with MSIEXEC.

What is the best way?  Where am I going wrong?

get-wmiobject -OutVariable prdid -Class Win32Reg_AddRemovePrograms -ComputerName rob_wyse | where {$_.Displayname -like "Blah*"} | select ProdID | fw

Invoke-Command -ComputerName rob_wyse "MsiExec.exe /norestart /q/x '$prid'"

Thanks for the help.

Rob


Thank you for your help and time, Robert Jaudon




Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>