I\'m using PowerShell scripts for some UI automation of a WPF application. Normally, the scripts are run as a group, based on the value of a global variable. It\'s a littl
Test-Path can be used with a special syntax:
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