public/New-PSUWorkflowModule.ps1
|
function New-PSUWorkflowModule { <# .SYNOPSIS Creates a PowerShell Universal workflow module from the Plaster template. .DESCRIPTION Scaffolds a module with a sample workflow, script command, and .universal registrations. .PARAMETER DestinationPath The path where the new module should be created. .PARAMETER ModuleName The full module name. .PARAMETER WorkflowName The name used for the sample workflow and its script command. .PARAMETER Description A brief description for the module. .PARAMETER Author The author name for the module. .PARAMETER Version The version number for the module. Default is '1.0.0'. #> [CmdletBinding(SupportsShouldProcess)] param( [Parameter(Mandatory)] [string] $DestinationPath, [Parameter()] [string] $ModuleName, [Parameter()] [string] $WorkflowName, [Parameter()] [string] $Description, [Parameter()] [string] $Author, [Parameter()] [string] $Version ) $templateParameters = @{} foreach ($name in 'ModuleName', 'WorkflowName', 'Description', 'Author', 'Version') { if ($PSBoundParameters.ContainsKey($name)) { $templateParameters[$name] = $PSBoundParameters[$name] } } if ($PSCmdlet.ShouldProcess($DestinationPath, 'Create new PSU Workflow Module')) { Invoke-PSUModuleTemplate -TemplateName 'PowerShellUniversalWorkflow' -DestinationPath $DestinationPath -TemplateParameters $templateParameters } } |