I’m attempting to test the Test-Path cmdlet on a path that I already know exists, as such:
Test-Path “\server1\engineering_store\H11824\case2_Case_Files\Nuix\simpleCases\H11824_2\InUse”
And it keeps returning false…Why?
Thanks
I’m attempting to test the Test-Path cmdlet on a path that I already know exists, as such:
Test-Path “\server1\engineering_store\H11824\case2_Case_Files\Nuix\simpleCases\H11824_2\InUse”
And it keeps returning false…Why?
Thanks
If you currently are in a location that is not using the filesystem drive, testing UNC-paths fails. To work around this, either use Set-Location -Path $Env:SystemDrive first or prepend filesystem:: to your path to tell test-path which psprovider to use, like this:
Test-Path -Path “filesystem::\server1\engineering_store”
That’s was great!! Thanks