Uninstall Programs using Get-Package/Uninstall-Package

How many of you guys are familiar with this window when try to uninstall a program or see what programs the server or client has installed1.jpg

I got  used to type appwiz.cpl because sometimes I needed to uninstall software or to check what version of the program is installed. Let me show you the new way to do this in PowerShell version 5.0 using Get-Package cmdlet.

When you Get-Package by itself you get the following2.jpg

Now to have a better view of what is installed you can pipe the cmdlet to Out-GridView

Get-Package | Out-GridView3.jpg

As you can see you cans scroll, select, copy and manage the data a lot easier.

The first gotcha i found is that * wildcard does not work. But no worries  if you just type part of the name it will reference and show all the packages that contains that name4.jpg

Now let’s try to remove a program using PowerShell. The cmdlet you need use is uninstall-package. Another gotcha you need to make sure when uninstalling programs the provider type is .msi. Use the following command to find that out

Get-Package | Where-Object {$_.ProviderName -like ‘msi’}

Now let’s  remove SAPIEN Primal Script

5.jpg

 

As you can see it is installed on the computer, now if i run

“PrimalScript 2015′ | Uninstall-Package” is going to start removing the program6.jpg

After a couple of seconds the computer should give you a warning message in case a reboot is needed7.jpg

This get you one more step closer to stop using the GUI.

This works with PowerShell V5

 

 

2 thoughts on “Uninstall Programs using Get-Package/Uninstall-Package

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s