Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

How to Import Cmdlets Using Modules

This topic describes how to import cmdlets to a Windows PowerShell session by using a binary module.

noteNote
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

  1. 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 system32 folder.

    %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\mymodule

  2. Make sure that the PSModulePath environment variable includes the path to your new module folder. By default, the system folder is already added to the PSModulePath environment variable.

  3. Copy the cmdlet assembly into the module folder.

  4. Run the following command to add the cmdlets to the session:

    import-module [Module_Name]

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.

See Also

Community Additions

ADD
Show:
© 2015 Microsoft