Remove-Module
Use Remove-Module to unload an imported module from the current session — handy when testing a new version of your own module.
Documentation: Microsoft Learn — remove-module
Syntax
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Remove-Module [-Name] <String[]> [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]
Remove-Module -FullyQualifiedName <ModuleSpecification[]> [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]- Stage 1Remove-Module
-Name -Force -WhatIf -Confirm -FullyQualifiedName -Force -WhatIf -Confirm
Try it
PowerShell example · browser support is limited.
Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.
Follow the objects
Run the command to inspect each stage.
Examples
Remove-Module -WhatIf
Show reference output
Illustrative output · values vary by environment
What if: Performing the operation "Remove Module" on target "Microsoft.PowerShell.Management".
Import-Module -Force #
Show reference output
Illustrative output · values vary by environment
ModuleType Version Name ---------- ------- ---- Script 3.1.0.0 Microsoft.PowerShell.Utility Binary 1.0.0.1 PackageManagement
Parameters
Parameter definitions:
-Name-FullyQualifiedName-Force-WhatIf
Unload a module without uninstalling it
Remove-Module removes an imported module and its exported commands from the current session. It leaves installed files on disk. Use Uninstall-Module for modules managed by PowerShellGet when you intend to remove an installed package.
Check the session first
Get-Module -Name Pester checks loaded modules; Get-Module -ListAvailable -Name Pester checks discovery on disk. Removing a module does not prevent PowerShell from importing it again when you call one of its commands.
Reloading has limits
Force-importing a script module can refresh functions, but an assembly loaded by a binary module may remain in the process. Start a fresh PowerShell session when you need to test a different loaded assembly.
Check the loaded modules again after removal. A successful removal normally has no pipeline output; a missing table of results does not mean nothing happened.
Inspect loaded and available modules · Import or reload a script module
Updated 1 October 2026. Browser outputs are fictional; check the installed module help for your environment.
Recap
Remove-Module Use Remove-Module to unload an imported module from the current session — handy when testing a new version of your own module.
Next: Get-Module