Home Dashboard Directory Help

Filename-Bracket problem? by Jakob Gottlieb Svendsen



Sign in
to vote
Type: Bug
ID: 544237
Opened: 3/24/2010 4:56:46 AM
Access Restriction: Public
User(s) can reproduce this bug



We have been diskussion it here.

When i do this on my PC i get the following results:
Directory: C:\Labs

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----        18-01-2010     14:13            test2
-a---        15-09-2009     10:33        172 path.vbs
-a---        23-03-2010     18:57         4 test[run-1001].txt
-a---        28-09-2009     13:14        868 test[test].hta
-a---        16-09-2009     14:23         95 Untitled.vbs

PS Labs:\> gci | get-acl

    Directory: C:\Labs

Path                                    Owner                                 Access
----                                    -----                                 ------
test2                                 BUILTIN\Administrators                 BUILTIN\Administrators Allow FullCo...
path.vbs                                BUILTIN\Administrators                 BUILTIN\Administrators Allow FullCo...
Untitled.vbs                            BUILTIN\Administrators                 BUILTIN\Administrators Allow FullCo...

I seems it is skipping the files with bracket names!

when i try to list one of them

PS Labs:\> gci test[1001-RUN].txt

i get no results !

when i try to use wildcard on both sides it is ok:

PS Labs:\> gci test?1001-RUN?.txt

    Directory: C:\Labs

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---        24-03-2010     12:14         4 test[1001-RUN].txt

PS Labs:\> gci test?1001-RUN].txt

    Directory: C:\Labs

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---        24-03-2010     12:14         4 test[1001-RUN].txt

PS Labs:\> gci "test[1001-RUN?.txt"
Get-ChildItem : The specified wildcard pattern is not valid: test[1001-RUN?.txt
At line:1 char:4
+ gci <<<< "test[1001-RUN?.txt"
    + CategoryInfo         : NotSpecified: (:) [Get-ChildItem], WildcardPatternException
    + FullyQualifiedErrorId : RuntimeException,Microsoft.PowerShell.Commands.GetChildItemCommand

but i seems that the 2 other guys in the thread, do not have the same problem!

they always get the error:

The specified wildcard pattern is not valid: OffscanOutput[Run-1001].txt

At :line:3 char:70

+ $_ | add-member -membertype noteproperty -name "Owner" -value (get-acl <<<< $_.fullname).owner

we are suspecting some culture settings differences?

and i bet it is messing up because of the square brackets is used in arrays.

other bug is:

if i try to use tab completion i get this result!
gci '.\test`[1001-RUN`].txt'

using escape chars inside a single quote string?? thats not allowed as far as i know ;)

another thing is that the get-acl does not have a litheralpath parameter, that might have helped the other guys, unfortunately i could never find i solution, since i do not get the same error!

but otherwise look at the thread, it has more info!

Sign in to post a comment.
Posted by Tom Nolan [MSFT] on 10/4/2012 at 11:00 AM
This was fixed in V3. Repro steps properly return the test file in V3.
Sign in to post a workaround.