Home Dashboard Directory Help
Search

Get-Acl should produce nonterminating errors when it fails to access a file or directory by David Wyatt


Status: 

Active


10
0
Sign in
to vote
Type: Bug
ID: 794618
Opened: 7/19/2013 9:15:41 PM
Access Restriction: Public
0
Workaround(s)
view
4
User(s) can reproduce this bug

Description

Get-Acl currently throws terminating errors anytime it fails to access a file or directory, even though it accepts an array of strings for the Path / LiteralPath parameters, and accepts pipeline input. Per Microsoft's guidelines for cmdlet error reporting (http://msdn.microsoft.com/en-us/library/windows/desktop/ms714412(v=vs.85).aspx), it seems like these should be non-terminating errors, as they are related to a specific input object, and should not prevent processing of more input objects.

It is currently only possible to work around this issue by piping objects to ForEach-Object (instead of directly to Get-Acl), and in the foreach block, call Get-Acl once for each object.
Details
Sign in to post a comment.
Sign in to post a workaround.