I've been tasked to uninstall "Rhino 6" from all Windows 10 computers. If I run:
gci "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" | foreach { gp $_.PSPath } | ? { $_ -match "Rhino 6" } | select UninstallString
Then I get a very useful:
UninstallString
---------------
"C:\ProgramData\Package Cache\{680b3429-6aab-4318-a4e1-74347755c79d}\Bootstrapper.exe" /uninstall
So, I wrote this:
Start-Process "C:\ProgramData\Package Cache\{75519ff1-80d4-4471-96c0-970328e182f1}\Bootstrapper.exe" -ArgumentList "/uninstall -quiet"
Which works great, except that there are MANY versions of "Rhino 6" and they each spit out a different uninstall string.
How can I make a script that does the first command and then uses the path from the answer in the second command without all of the other stuff that gets spit out?