An example module used in PowerShell Universal v4 to define resources.
The .universal
folder contains scripts that will define resources within PowerShell Universal. These resources will be read-only.
In order to properly load resources from a module, resources need to use the -Module
and -Command
parameters rather than any path-specific parameters.
New-PSUEndpoint -Url "/start" -Method @('GET') -Module "PSUModule" -Command "Start-Endpoint"
App components can be defined in modules and then used within apps. To support the App designer, you need to include the Component
attribute with a name and description for your component.
function New-UDRedbox {
[Component("Redbox", "A textbox with a red border.")]
param(
[Parameter()]
[string]$Id
)
New-UDStyle -style "border: 2px solid red" -Content {
New-UDTextbox -Id $Id
}
}