public/New-PSUComponentModule.ps1

function New-PSUComponentModule {
    <#
    .SYNOPSIS
    Creates a PowerShell Universal component module from the Plaster template.
 
    .DESCRIPTION
    Scaffolds a module with a sample React component, PowerShell wrapper, and webpack build setup.
 
    .PARAMETER DestinationPath
    The path where the new module should be created.
 
    .PARAMETER ModuleName
    The full module name.
 
    .PARAMETER ComponentName
    The PascalCase name used for the sample component and PowerShell 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]
        $ComponentName,

        [Parameter()]
        [string]
        $Description,

        [Parameter()]
        [string]
        $Author,

        [Parameter()]
        [string]
        $Version
    )

    $templateParameters = @{}
    foreach ($name in 'ModuleName', 'ComponentName', 'Description', 'Author', 'Version') {
        if ($PSBoundParameters.ContainsKey($name)) {
            $templateParameters[$name] = $PSBoundParameters[$name]
        }
    }

    if ($PSCmdlet.ShouldProcess($DestinationPath, 'Create new PSU Component Module')) {
        Invoke-PSUModuleTemplate -TemplateName 'PowerShellUniversalComponent' -DestinationPath $DestinationPath -TemplateParameters $templateParameters
    }
}