How to Import Cmdlets Using Modules
This article describes how to import cmdlets to a PowerShell session by using a binary module.
The members of modules can include cmdlets, providers, functions, variables, aliases, and much more. Snap-ins can contain only cmdlets and providers.
How to load cmdlets using a module
Create a module folder that has the same name as the assembly file in which the cmdlets are implemented. In this procedure, the module folder is created in the Windows
Make sure that the
PSModulePathenvironment variable includes the path to your new module folder. By default, the system folder is already added to the
PSModulePathenvironment variable. To view the
Copy the cmdlet assembly into the module folder.
Add a module manifest file (
.psd1) in the module's root folder. PowerShell uses the module manifest to import your module. For more information, see How to Write a PowerShell Module Manifest.
Run the following command to add the cmdlets to the session:
This procedure can be used to test your cmdlets. It adds all the cmdlets in the assembly to the session. For more information about modules, see Writing a Windows PowerShell Module.