Dude, where's my variable? Understanding scoping in Universal Dashboard

Dude, where’s my variable? Understanding scoping in #PowerShell Universal Dashboard https://ironmansoftware.com/dude-wheres-my-variable-understanding-scoping-in-universal-dashboard/

1 Like

@adam can you use the () on endpoints? From the good read I was querying

indent preformatted text by 4 spaces1..100 | ForEach-Object {
 New-UDElement -tag 'div' -Endpoint (
     New-UDEndpoint -Endpoint { $ArgumentList[0] } -ArgumentList $_
 )

}

Nope. That was incorrect. Ive updated the post. You can do that with controls like New-UDButton but not with New-UDElement. Honestly, it’s a bit of a design flaw. New-UDElement has an ArgumentList parameter itself. I think that other controls should be more like New-UDElement but they are not.

Thanks for clarifying this @adam

Thanks. This is extremely helpful.