Templates/PowerShellUniversalComponent/public/New-UDComponent.ps1

function New-UD<%=$PLASTER_PARAM_ComponentName%> {
    [CmdletBinding()]
    param(
        [Parameter()]
        [string]
        $Id = (New-Guid).ToString(),

        [Parameter()]
        [string]
        $Text = 'Hello from PowerShell Universal',

        [Parameter()]
        [hashtable]
        $Style = @{}
    )

    if (-not $Script:AssetId) {
        throw 'Component JavaScript bundle is not registered. Run npm install and npm run build, then import the module in PowerShell Universal.'
    }

    @{
        assetId  = $Script:AssetId
        isPlugin = $true
        type     = 'ud-<%=$PLASTER_PARAM_ComponentName.ToLowerInvariant()%>'
        id       = $Id
        text     = $Text
        style    = $Style
    }
}