Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uninstall AWSPowerShell/AWS.Tools module from Powershell?

First steps in Powershell. I can not remove / uninstall AWSPowerShell module from AWS installed modules. Get-Module -Name AWSPowerShell,AWSPowerShell.NetCore,AWS.Tools.Common -ListAvailable showing as follows:

    Directory: C:\Users\user\Documents\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Binary     4.1.14.0              AWS.Tools.Common                    Core,Desk {Clear-AWSHistory, Set-AWSHistoryConfiguration, Initialize-AWSDefaultConfi…

    Directory: C:\Program Files (x86)\AWS Tools\PowerShell

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Binary     3.3.509.0             AWSPowerShell                       Desk

Whem I'm trying to uninstall it via Uninstall-Module -Name AWSPowerShell I'm getting error:

    Uninstall-Package: C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:12733
 Line |
12733 |  …        $null = PackageManagement\Uninstall-Package @PSBoundParameters
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      | No match was found for the specified search criteria and module names 'AWSPowerShell'.

Question - how can i get rid of this one?

like image 902
Maciej Avatar asked Nov 04 '25 16:11

Maciej


1 Answers

You need to simply delete it. If you want to do it via PowerShell, you can do something like this:

Get-Module -Name <ModuleName> -ListAvailable | Select-Object -ExpandProperty ModuleBase | Remove-Item -Recurse -Force
like image 97
Mickey Cohen Avatar answered Nov 07 '25 12:11

Mickey Cohen