Issue with Uninstall-Module in PowerShell

%3CLINGO-SUB%20id%3D%22lingo-sub-1598585%22%20slang%3D%22en-US%22%3EIssue%20with%20Uninstall-Module%20in%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1598585%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20have%20installed%20the%20latest%20version%20of%20the%20module%20PowerShell%20Get%20(2.2.4.1)%3CBR%20%2F%3ENow%20I%20wanted%20to%20uninstall%20the%20older%20version%201.0.0.1%2C%20but%20I%20can'%20t%20do%20that%20with%20the%20Uninstall-Module%20cmdlet.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EHost%20System%3A%20Windows%20Server%202012R2%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EPowerShell%20Version%3A%26nbsp%3B%205.1.14409.1018%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20that%3A%3C%2FP%3E%3CP%3E%3CSTRONG%3EUninstall-Module%20-Name%20PowerShellGet%20-RequiredVersion%201.0.0.1%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20following%20error%20message%3A%3C%2FP%3E%3CP%3EPackageManagement%5CUninstall-Package%20%3A%20No%20match%20was%20found%20for%20the%20specified%20search%20criteria%20and%20module%20name%3CBR%20%2F%3EPowerShellGet.%3CBR%20%2F%3EAt%20C%3A%5CProgram%20Files%20(x86)%5CWindowsPowerShell%5CModules%5CPowerShellGet%5C1.0.0.1%5CPSModule.psm1%3A2157%20char%3A21%3CBR%20%2F%3E%2B%20...%20%24null%20%3D%20PackageManagement%5CUninstall-Package%20%40PSBoundParameters%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20ObjectNotFound%3A%20(Microsoft.Power...ninstallPackage%3AUninstallPackage)%20%5BUninst%3CBR%20%2F%3E%2C%20Exception%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20NoMatchFound%2CMicrosoft.PowerShell.PackageManagement.Cmdlets.UninstallPackage%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20the%20folders%20are%20in%20C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20Idea%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1598585%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1607199%22%20slang%3D%22en-US%22%3ERe%3A%20Issue%20with%20Uninstall-Module%20in%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1607199%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F764349%22%20target%3D%22_blank%22%3E%40JuliWin%3C%2FA%3E%26nbsp%3BCan%20you%20try%20to%20run%20the%20below%20command%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EUninstall-Script%20-Name%20PowerShellGet%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1610318%22%20slang%3D%22en-US%22%3ERe%3A%20Issue%20with%20Uninstall-Module%20in%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1610318%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F160515%22%20target%3D%22_blank%22%3E%40Dayanand%20Gavas%3C%2FA%3E%20i%26nbsp%3Bhave%20tried%2C%20but%20it%20didn't%20work%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%222020-08-25_13h37_21.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F214624i79B7A82F077537E5%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%222020-08-25_13h37_21.png%22%20alt%3D%222020-08-25_13h37_21.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New 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