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.
Create a module directory. The following example command creates a module directory called ManagedRoles in the user's Modules directory.
Important Do not name a module the same name as any other modules that are located in your module path.
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