Export (0) Print
Expand All

Saving Your Workflow in a Module

Published: June 24, 2013

Updated: June 24, 2013

Applies To: Windows 8, Windows PowerShell 4.0, Windows Server 2012, Windows Server 2012 R2



After authoring a Windows PowerShell script workflow as described in Writing a Script Workflow, or authoring a XAML workflow, you can save the workflow as a module. Storing workflows in a module makes it easier for you to package, distribute, describe, and install them easily.

The example workflow in the following procedure, Install-Role.ps1, is a Windows PowerShell script workflow.

  1. Create a module directory. The following example command creates a module directory called ManagedRoles in the user's Modules directory.

    mkdir C:\Users\CoolDev\WindowsPowerShell\Modules\ManagedRoles

    ImportantImportant
    Do not name a module the same name as any other modules that are located in your module path.

  2. Copy at least one Windows PowerShell script-based or XAML workflow file into the module directory, as shown in the following example command.

    copy-item .\Install-Role.ps1 -dest C:\Users\CoolDev\WindowsPowerShell\Modules\ManagedRoles

See Also

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft