I'm having trouble using the Powershell CmdLet Test-Path.
I created a Share on a Server (\\Servername\MyShare$), which allows one Group of users to just create a file and append data, while others users can just read and delete these files. The first group is not allowed to do anything else, including Read-Permissions, Read-Attributes and so on.
If I do a Test-Path on this folder as member of the "drop files only" group, it returns false. Even [System.IO.Directory]::Exists()
returns false.
I am searching for a way to test if a directory exists without the need to have Read-Permissions or Read-Attributes rights. Any ideas?
Is this the correct behaviour of those two methods?
Regards, teamoo
Ok, if nobody want to venture ...
Here is a solution :
I'am not allowed to access to directory
.\f1\f2
and.\f1\f3
does not exists.So if you test
$Error[0].exception.gettype()
after theGet-Item
you can understand why it's not accessible, so if it exists or not. You can call that "bricolage", but it's also a solution. Sorry for the french in the example.