Test-Path can be used with a special syntax:
Test-Path variable:global:foo
This also works for environment variables ($env:foo):
Test-Path env:foo
And for non-global variables (just $foo inline):
Test-Path variable:foo
Test-Path can be used with a special syntax:
Test-Path variable:global:foo
This also works for environment variables ($env:foo):
Test-Path env:foo
And for non-global variables (just $foo inline):
Test-Path variable:foo