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 - PowerShell User Guide - Comparison Operators - error?

Reply
 
Old 08-19-2006   #1 (permalink)
=?Utf-8?B?RGF2aWQgSyBBbGxlbg==?=


 
 

PowerShell User Guide - Comparison Operators - error?

Is there a mistake in the section that reads as follows?
"Comparisons of types that are not the same are based on the right hand side
of the operator. The shell will attempt to convert the left hand side of
the operator into the type of the right hand side of the operator. "
My tests show the current release converts the right hand side to the left
hand side.
Example:
PS D:\> $sb1 = new-object system.text.stringbuilder test
PS D:\> $sb1 -eq "test"
False
PS D:\> "test" -eq $sb1
True
--
David K Allen
Carlson School of Management
University of Minnesota
Minneapolis, MN

My System SpecsSystem Spec
Old 08-28-2006   #2 (permalink)
James Truher


 
 

Re: PowerShell User Guide - Comparison Operators - error?

yep - that's a typo - good catch!

jim

--
James Truher[MSFT]
Program Manager - Windows PowerShell
Microsoft Corporation
This posting is provided "AS IS" with no warranties, no confers 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
"David K Allen" <David_UMN@newsgroups.nospam> wrote in message
news:3BF0C994-ED8F-455C-929F-FAFE397C2FEC@microsoft.com...
> Is there a mistake in the section that reads as follows?
> "Comparisons of types that are not the same are based on the right hand
> side
> of the operator. The shell will attempt to convert the left hand side of
> the operator into the type of the right hand side of the operator. "
> My tests show the current release converts the right hand side to the left
> hand side.
> Example:
> PS D:\> $sb1 = new-object system.text.stringbuilder test
> PS D:\> $sb1 -eq "test"
> False
> PS D:\> "test" -eq $sb1
> True
> --
> David K Allen
> Carlson School of Management
> University of Minnesota
> Minneapolis, MN



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Re: Comparison of two AD user queries VB Script
Desktop CPU Comparison Guide Vista News
Desktop Graphics Card Comparison Guide Graphic cards
Powershell Operators PowerShell
CTP2 comparison operators PowerShell


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