Issue with Uninstall-Module in PowerShell

Copper Contributor

Hi,

I have installed the latest version of the module PowerShell Get (2.2.4.1)
Now I wanted to uninstall the older version 1.0.0.1, but I can' t do that with the Uninstall-Module cmdlet.

 

Host System: Windows Server 2012R2

PowerShell Version:  5.1.14409.1018

 

I tried that:

Uninstall-Module -Name PowerShellGet -RequiredVersion 1.0.0.1

 

The following error message:

PackageManagement\Uninstall-Package : No match was found for the specified search criteria and module name
PowerShellGet.
At C:\Program Files (x86)\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:2157 char:21
+ ... $null = PackageManagement\Uninstall-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power...ninstallPackage:UninstallPackage) [Uninst
, Exception
+ FullyQualifiedErrorId : NoMatchFound,Microsoft.PowerShell.PackageManagement.Cmdlets.UninstallPackage

 

But the folders are in C

 

Any Idea?

2 Replies

@JuliWin Can you try to run the below command

Uninstall-Script -Name PowerShellGet

 

Hi @Dayanand Gavas i have tried, but it didn't work 

 

2020-08-25_13h37_21.png