I have a script that tries to run some executable using a relative path.
So I use test-path to verify that the executable is where it is supposed to be.
If not I try another location.
if(test-path "$current../../../myexe.exe"){
# found it!
}
But in this case, if the $current is C:/folder/ then test-path "C:/folder/../../../myexe.exe" fails with
The path ... referred to an item that was outside the base 'C:'
Is there a clean and sure way to test for a path, so that it returns true or false, and won't throw me some unexpected error?