Author Posts

March 8, 2018 at 7:46 pm

Hello everyone,
I'm sorry for poor English.
I would like to start with Powershell. First I want to explore the possibilities to configure my local computer (Windows 10) with Powershell. I try, in my opinion a simple thing, to uninstall multiple software packages. But it seems it's still not so easy for me.

I wrote this and I got no error, but it doesn't work. Obviously I don't understand it yet. Can you tell me how it works please? Thank you.

PS C:\> get-package -name *sapien*

Name                           Version          Source                           ProviderName
----                           -------          ------                           ------------
SAPIEN Document Explorer 2018  3.1.82.0                                          Programs
SAPIEN PowerShell Studio 2018  5.5.149.0                                         Programs
SAPIEN ScriptMerge 2018        1.3.74.0                                          Programs


PS C:\> get-package -name *sapien* | uninstall-package
PS C:\> get-package -name *sapien*

Name                           Version          Source                           ProviderName
----                           -------          ------                           ------------
SAPIEN Document Explorer 2018  3.1.82.0                                          Programs
SAPIEN PowerShell Studio 2018  5.5.149.0                                         Programs
SAPIEN ScriptMerge 2018        1.3.74.0                                          Programs


PS C:\>

March 8, 2018 at 7:48 pm

The docs actually have the clue, I think. If you look at https://docs.microsoft.com/en-us/powershell/module/packagemanagement/get-package?view=powershell-6, you'll see where it says, "Returns a list of all software packages that have been installed by using Package Management."

If the package wasn't installed by Install-Package, then Uninstall-Package can't usually remove it.

March 8, 2018 at 8:10 pm

I see now. It means, software which I installed by "double click" have to uninstall by "Programs and Features"?

March 8, 2018 at 8:11 pm

Or by manually running their uninstaller, if they have one. For some programs, you can also use Win32_Product, which return instances having an Uninstall() method.

March 8, 2018 at 8:24 pm

Ah, ok. Thanks. I will tinker something. By the way, your YouTube videos aroused my interest to play with Powershell. You're a funny guy. 😉

March 9, 2018 at 1:13 pm

I think I initially replied to the wrong post.