Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Known bug? arbitrary switch options work.

Reply
 
Old 10-24-2006   #1 (permalink)
Alex K. Angelopoulos [MVP]


 
 

Known bug? arbitrary switch options work.

Is this a known bug? You can specify arbitrary switch options whose initial
parts match specific options.


PS> switch -c ('abc') {'abc' {"one"} 'ABC' {"two"}}
one
PS> switch -cf ('abc') {'abc' {"one"} 'ABC' {"two"}}
one



My System SpecsSystem Spec
Old 10-24-2006   #2 (permalink)
George Xie [MSFT]


 
 

Re: Known bug? arbitrary switch options work.

Yes. This looks like bug. In current implementation, we just match the first
character. Please post a bug on this.

--
George Xie [MSFT]
Microsoft Command Shell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.

"Alex K. Angelopoulos [MVP]" <aka@online.mvps.org> wrote in message
news:uzVJjC49GHA.1200@TK2MSFTNGP02.phx.gbl...
> Is this a known bug? You can specify arbitrary switch options whose
> initial parts match specific options.
>
>
> PS> switch -c ('abc') {'abc' {"one"} 'ABC' {"two"}}
> one
> PS> switch -cf ('abc') {'abc' {"one"} 'ABC' {"two"}}
> one
>



My System SpecsSystem Spec
Old 10-24-2006   #3 (permalink)
Alex K. Angelopoulos [MVP]


 
 

Re: Known bug? arbitrary switch options work.

Done:
https://connect.microsoft.com/feedba...1373&SiteID=99

"George Xie [MSFT]" <gxie@online.microsoft.com> wrote in message
news:O$peCP59GHA.4404@TK2MSFTNGP04.phx.gbl...
> Yes. This looks like bug. In current implementation, we just match the
> first character. Please post a bug on this.
>
> --
> George Xie [MSFT]
> Microsoft Command Shell Development
> Microsoft Corporation
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Alex K. Angelopoulos [MVP]" <aka@online.mvps.org> wrote in message
> news:uzVJjC49GHA.1200@TK2MSFTNGP02.phx.gbl...
>> Is this a known bug? You can specify arbitrary switch options whose
>> initial parts match specific options.
>>
>>
>> PS> switch -c ('abc') {'abc' {"one"} 'ABC' {"two"}}
>> one
>> PS> switch -cf ('abc') {'abc' {"one"} 'ABC' {"two"}}
>> one
>>

>
>



My System SpecsSystem Spec
Old 10-25-2006   #4 (permalink)
Keith Hill [MVP]


 
 

Re: Known bug? arbitrary switch options work.

"Alex K. Angelopoulos [MVP]" <aka@online.mvps.org> wrote in message
news:uzVJjC49GHA.1200@TK2MSFTNGP02.phx.gbl...
> PS> switch -cf ('abc') {'abc' {"one"} 'ABC' {"two"}}
> one


Whoa, what's with the -cf? What option does that map to? Surely
not -casesensitive. And surely not -casesensitive -file. What gives??

--
Keith


My System SpecsSystem Spec
Old 10-26-2006   #5 (permalink)
Alex K. Angelopoulos [MVP]


 
 

Re: Known bug? arbitrary switch options work.

Yep; only the first character of the option is examined. So
even -caseINsensitive is interpreted as -casesensitive.



"Keith Hill [MVP]" <r_keith_hill@mailhot.moc.nospam> wrote in message
news:uxNFDpK%23GHA.4524@TK2MSFTNGP04.phx.gbl...
> "Alex K. Angelopoulos [MVP]" <aka@online.mvps.org> wrote in message
> news:uzVJjC49GHA.1200@TK2MSFTNGP02.phx.gbl...
>> PS> switch -cf ('abc') {'abc' {"one"} 'ABC' {"two"}}
>> one

>
> Whoa, what's with the -cf? What option does that map to? Surely
> not -casesensitive. And surely not -casesensitive -file. What gives??
>
> --
> Keith
>



My System SpecsSystem Spec
Old 10-27-2006   #6 (permalink)
Bruce Payette [MSFT]


 
 

Re: Known bug? arbitrary switch options work.

This is a known bug. It's actually been around for a while. It just wasn't
considered serious enought to fix for V1.

-bruce

--
Bruce Payette [MSFT]
Windows PowerShell Technical Lead
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.

Visit the Windows PowerShell Team blog at:
http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:
http://www.microsoft.com/technet/scr.../hubs/msh.mspx
My Book: http://manning.com/powershell

"George Xie [MSFT]" <gxie@online.microsoft.com> wrote in message
news:O$peCP59GHA.4404@TK2MSFTNGP04.phx.gbl...
> Yes. This looks like bug. In current implementation, we just match the
> first character. Please post a bug on this.
>
> --
> George Xie [MSFT]
> Microsoft Command Shell Development
> Microsoft Corporation
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Alex K. Angelopoulos [MVP]" <aka@online.mvps.org> wrote in message
> news:uzVJjC49GHA.1200@TK2MSFTNGP02.phx.gbl...
>> Is this a known bug? You can specify arbitrary switch options whose
>> initial parts match specific options.
>>
>>
>> PS> switch -c ('abc') {'abc' {"one"} 'ABC' {"two"}}
>> one
>> PS> switch -cf ('abc') {'abc' {"one"} 'ABC' {"two"}}
>> one
>>

>
>



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Switch to 64 bit - will it work? Virtual PC
User switch doesn’t work on Windows Vista Virtual PC
KVM Switch does not work in the Vista? Vista General
Arbitrary changes Vista General
Anyway to switch from Work network setting to Home? Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46