Hide all content inside a New-UDDynamic

I have some things inside a New-UDDynamic and I want to only show that when I activate a switch I know how to do -OnChange with the UDSwitch but I can’t figure out how to hide all the content in the New-UDDynamic

Product: PowerShell Universal
Version: 3.1.4

You could use a session variable and sync-udelement.

New-UDDyanmic Id 'mycontent' -Content {
   if ($Session:SwitchChecked) {
# Display some stuff

Perfect! It was so simple that I did not thing about it :slight_smile: my solution that I was thinking of was far more complex.