Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove all imported modules in PowerShell?

I wan to remove all imported modules before importing them so that I can get the fresh ones by overwriting the ones in the memory.

How can I remove all imported modules in PowerShell?

Thanks

like image 409
pencilCake Avatar asked Dec 06 '12 06:12

pencilCake


People also ask

How do I remove all PowerShell modules?

If you have multiple versions of the same module installed in the PowerShell, and if you want to uninstall all of them then use the -AllVersions Parameter. If you want to uninstall the specific version, we can use -RequiredVersion. To uninstall on the remote computer, use the Invoke-Command method.

How do I delete an imported module in PowerShell?

VERBOSE: Removing imported function 'Get-LogProperties'. VERBOSE: Removing imported function 'Enable-PSTrace'. VERBOSE: Removing imported function 'Disable-PSTrace'. VERBOSE: Performing operation "Remove-Module" on Target "PSDiagnostics (Path: 'C:\Windows\system32\WindowsPowerShell\v1.

Which removes a module that you added to the current session?

The Remove-Module cmdlet removes the members of a module, such as cmdlets and functions, from the current session. If the module includes an assembly (. dll), all members that are implemented by the assembly are removed, but the assembly is not unloaded.


1 Answers

this should do it:

get-module | Remove-Module

this remove also imported modules in $profile.

More about this

like image 88
CB. Avatar answered Nov 14 '22 23:11

CB.