Product: Universal Dashboard
Version: 2.9.0
I need to loop through variables inside the $Cache scope, but I can’t get them dynamically using Get-Variable:
Ex:
$InternalVariables = @(
'Status'
'Cleared'
'Published'
)
$InternalVariables | ForEach {
$variable = (Get-Variable -name "$Cache:$($_)").Value
}
I need $variable to get the $Cache:Status, $Cache:Cleared and $Cache:Published values inside the loop. From what I’ve seen, it doesn’t work because $ is a wildcard (escaping doesn’t help). Also, it’s not possible to inform the $Cache scope using the -Scope parameter.
Is there a way to access these variables dynamically like this?