How to Import Cmdlets Using Modules
This topic describes how to import cmdlets to a Windows 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 user folder. You can also create module folders in the system folder, as follows:
If you create a module folder in a location other than the user or system folder, make sure that the
PSModulePathenvironment variable includes the path to your new module folder. By default, the user and system folders are already added to the
Copy the cmdlet assembly into the module folder.
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, the different types of modules, the different ways to load modules, and how to restrict the elements of a module that are exported, see Writing a Windows PowerShell Module.
Other ResourcesWriting a Windows PowerShell Cmdlet