PowerShellEditorServices icon indicating copy to clipboard operation
PowerShellEditorServices copied to clipboard

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

Open JustinGrote opened this issue 3 years ago • 1 comments

image

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.

JustinGrote avatar Jan 28 '22 16:01 JustinGrote

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.

fflaten avatar Aug 05 '22 08:08 fflaten