Skip to content

Uninstall-Module throws "No match was found" error. #34

@dronkoff

Description

@dronkoff

Steps to reproduce

Install something from PSGallery, then try to uninstall it.

C:\> Install-Module AzSK

Expected behavior

Module is uninstalled.

C:\> Uninstall-Module AzSK
C:\>

Actual behavior

Error "No match was found for the specified search criteria and module names 'AzSK'".

PS C:\> Get-Module AzSK -ListAvailable
    Directory: C:\Users\vdronov\OneDrive - Microsoft\Documents\PowerShell\Modules
ModuleType Version    Name                                PSEdition ExportedCommands
---------- -------    ----                                --------- ----------------
Script     4.3.0      AzSK                                Desk      {Get-AzSKAccessToken, Get-AzSKSupportedResourceTyp…

PS C:\> Uninstall-Module AzSK
PackageManagement\Uninstall-Package : No match was found for the specified search criteria and module names 'AzSK'.
At C:\program files\powershell\6\Modules\PowerShellGet\PSModule.psm1:12451 char:21
+ ...        $null = PackageManagement\Uninstall-Package @PSBoundParameters
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Microsoft.PowerShel\u2026ts.UninstallPackage:UninstallPackage) [Uninstall-Package], Exception
+ FullyQualifiedErrorId : NoMatchFound,Microsoft.PowerShell.PackageManagement.Cmdlets.UninstallPackage

Environment data

PS C:\> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.2.3
PSEdition                      Core
GitCommitId                    6.2.3
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions