PowerShellEditorServices
PowerShellEditorServices copied to clipboard
Variables: Pester Variable in BeforeAll scope not visible in variable list (but is watchable)

To be clear it's not in local/script/global either. I would expect it to be in local. This is probably an issue in how we fetch variables from the various stacks, or maybe Pester exposes this variable in a weird way.
BeforeAll is just invoked a couple of scopes above. Nothing special. You can repro the problem using:
& {
$newVar = 123
'visible here'
& {
'not here'
}
}
If you place the variable in the root it works, but not when it's defined in a inner scope.