Skip to main content

Templatevariable

Properties

NameTypeDescriptionNotes
KeyStringThe variable name as used when rendering context in templates.[optional]
TypeEnum [ "string", "boolean", "number", "object", "array", "function" ]The data type for this variable. Use JSON Schema-like names for values (string, boolean, number, object, array) or ""function"" for template utility/helper functions (e.g. __dateTool.format(), __esc.html()).[optional]
DescriptionStringHuman-readable description explaining what this variable represents.[optional]
Example[AnyType]https://learn.microsoft.com/en-us/powershell/scripting/lang-spec/chapter-04?view=powershell-7.4Example value demonstrating the format and usage. For type ""function"", often a Velocity-style call (e.g. $__esc.html($value)). Can be a string, number, boolean, object, array, or null when no example is defined.[optional]

Examples

  • Prepare the resource
$Templatevariable = Initialize-Templatevariable  -Key recipientDisplayName `
-Type string `
-Description Display name of the notification recipient `
-Example John Doe
  • Convert the resource to JSON
$Templatevariable | ConvertTo-JSON

[Back to top]