Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

get-acl : Cannot find path '\\fileshare\test\Share\' because it does not exist

$
0
0

Hello all, 

Iam getting the following error when i use $acc=(get-acl $file).Access

$file is a obtained from a database with the following query:

foreach ($file in Invoke-Sqlcmd -Query "select FO_ID,FULL_PATH from dbo.$T_FOLDERS" -ServerInstance "xxx\xxx" -Database "xxx"  |select -ExpandProperty FULL_PATH)


 ERROR:

get-acl : Cannot find path '\\fileshare\test\Share\' because it does not exist.
At line:17 char:11
+     $acc=(get-acl $file).Access
+           ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (:) [Get-Acl], ItemNotFoundException
    + FullyQualifiedErrorId : GetAcl_PathNotFound_Exception,Microsoft.PowerShell.Commands.GetAclCommand

Can anyone help me with this one?

Regards,

Arestas


Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>