Is there any easy routine for listing all the variables and their values for a give scope?
If I have the following script scope variables:
$script:var1 = 1
$script:var2 = 2
$script:var3 = 3
For debugging, I can write the following to list their values:
Write-Host “script:var1: $script:var1”
Write-Host “script:var2: $script:var2”
Write-Host “script:var3: $script:var3”
But I have to continually modify it as variables come and go. Any easy way that I can look through an object and get the same results? That way I’d never have to change that part of the debugging script and miss any.