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