Conditions

Conditions within portal widgets.

You can use the <Condition /> component within widgets to optionally display sections of the widget.

Script Block

Using the ScriptBlock attribute to define a Script Block to determine the value of the condition. The script block needs to return true or false.

<Condition ScriptBlock="$Errors -eq $null">
</Condition>

Child Content

The ChildContent section will be displayed if the condition is true.

<Condition ScriptBlock="$Errors -eq $null">
   <ChildContent>
      <Alert Message="Success!" />
   </ChildContent>
</Condition>

Else

The Else section will be displayed if the condition is false.

<Condition ScriptBlock="$Errors -eq $null">
   <ChildContent>
      <Alert Message="Success!" />
   </ChildContent>
   <Else>
      <Alert Message="Failure!" Type="error" ShowIcon="true" />
   </Else>
</Condition>

Last updated

PowerShell Universal

DownloadsPricingModules

Community

IssuesForums

Copyright 2024 Ironman Software