header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

get-acl and escape character [
Last Post 01 Jul 2008 02:25 PM by bsonposh. 3 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
viralUser is Offline
New Member
New Member
Posts:5
Avatar

--
29 Jun 2008 11:41 AM  

Hi

I have folder name [[[ in d:\test

get-acl "d:\test\[[[" give wildcard error

using escape sequence it is not working

using tilde character with Get-ChildItem  it is working

Get-ChildItem  'd:\Test\*``[*' -> it is working but with get-acl it is not working

Since get-acl doesnot have -literalpath how  to find acl of such file

Is this error in powershell.

Is there any other way to find acl of such file.

 

Thanks in advance

 

 

 

halr9000User is Offline
PowerShell MVP, Site Admin
Basic Member
Basic Member
Posts:335
Avatar

--
29 Jun 2008 03:19 PM  
PowerShell adds a few characters which you should not use in filenames. brackets and parentheses are the big ones. You can do it, but it's going to be a bit of a headache. I strongly suggest you not use them in filenames whenever possible.

Hmm. After looking at this for a minute, I think I agree that it is a bug. Get-Acl should have a Literalpath parameter. I would've expected this to work, but it does not:

PS > gi -LiteralPath `[`[`[.txt | Get-Acl
Get-Acl : The specified wildcard pattern is not valid: [[[.txt
At line:1 char:37
+ gi -LiteralPath `[`[`[.txt | Get-Acl <<<<

I searched Connect and did not see anything matching so I went and submitted a bug report. You should sign up at Connect yourself and vote for this bug so that it'll get more visibility.

sign up here
bug report
Community Director, PowerShellCommunity.org
Co-host, PowerScripting Podcast
Author, TechProsaic
viralUser is Offline
New Member
New Member
Posts:5
Avatar

--
01 Jul 2008 08:55 AM  

Is there any other way to find the acl of a file that contain escape character [ in powershell.

 

Thanks in advance

 

bsonposhUser is Offline
Basic Member
Basic Member
Posts:392
Avatar

--
01 Jul 2008 02:25 PM  
I posted an answer in your other thread
Brandon Shell
----------------
Microsoft Powershell MVP
https://mvp.support.microsoft.com/profile/Brandon
Blog: http://www.bsonposh.com
You are not authorized to post a reply.

Active Forums 4.1
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer