Removing a module

If you decide that you don't want the functions in a module included in your session for some reason, you can remove it using the Remove-Module cmdlet. Once the module is removed, you can try to check whether it was removed using the Get-Command cmdlet to look for one of the exported functions:

Removing a module

Wait a minute! We removed the module and it didn't give us an error, but then both the area functions are in the session and they have been reported as being in the AreaFunctions module. To understand what's going on, we need to understand module autoloading.

Get Getting Started with PowerShell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.