How to uninstall the PowerShell Module?

To uninstall a PowerShell module use the Uninstall-Module command. The module should not be in use to uninstall it.

Uninstall-Module -Name MODULE_NAME_HERE

To force uninstall a module run

Uninstall-Module -Name MODULE_NAME_HERE -Force -Verbose

To uninstall all versions of a module, use option -AllVersions

Uninstall-Module -Name MODULE_NAME_HERE -AllVersions -Force -Verbose

If you need to keep a version and uninstall all other versions, run

Uninstall-Module -Name MODULE_NAME_HERE -RequiredVersion 2.1.2 -Force -Verbose

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *