<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx</link><description>We are struggling with whether or not to make a change in our comparison operators and would like feedback from the community. Here is the documentation about comparision operators: All comparison operators are case-insensitive by default. To make a comparison</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8961820</link><pubDate>Tue, 23 Sep 2008 05:05:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8961820</guid><dc:creator>Doug</dc:creator><description>&lt;p&gt;I like that PowerShell lets me mine data quickly. I don't have to think about case. &lt;/p&gt;
&lt;p&gt;$_.Ticker -match 'ibm'&lt;/p&gt;
&lt;p&gt;I'd prefer consistency and fix scripts that had issues. &lt;/p&gt;
&lt;p&gt;Otherwise I have to keep lots of rules in my head depending on the type of data I am comparing.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8961839</link><pubDate>Tue, 23 Sep 2008 05:46:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8961839</guid><dc:creator>Adrian</dc:creator><description>&lt;p&gt;I came across this post looking for something entirely different. Truth be told I have not used PowerShell yet!&lt;/p&gt;
&lt;p&gt;This clearly presents as a bug and should be fixed. I empathise with the decision that needs to be made, however if it's left as is then the problem will be forever recorded in history as one of those PowerShell peculiarities that should have been fixed long ago. You'll end up inconveniencing more people as the adopted userbase expands.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8961843</link><pubDate>Tue, 23 Sep 2008 05:51:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8961843</guid><dc:creator>Andy</dc:creator><description>&lt;p&gt;Feel it should remain as it is:&lt;/p&gt;
&lt;p&gt;PS&amp;gt; [char]'a' -eq 'A'&lt;/p&gt;
&lt;p&gt;False&lt;/p&gt;
&lt;p&gt;Since this is surely True, that 'a' and 'A' are not equivalent ...&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Andy&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8961849</link><pubDate>Tue, 23 Sep 2008 06:01:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8961849</guid><dc:creator>Pete</dc:creator><description>&lt;p&gt;IMO, it is a bug and should be fixed. The following currently returns true:&lt;/p&gt;
&lt;p&gt; &amp;nbsp;'a' -eq [char]'A'&lt;/p&gt;
&lt;p&gt;and this returns false:&lt;/p&gt;
&lt;p&gt; &amp;nbsp;'a' -ceq [char]'A'&lt;/p&gt;
&lt;p&gt;So apparently the [char] casting only matters on the left side of the equation? I would expect it to work the same regardless of where I do the casting.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8961865</link><pubDate>Tue, 23 Sep 2008 06:25:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8961865</guid><dc:creator>Greg Lyon</dc:creator><description>&lt;p&gt;I think that it should be fixed.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8961871</link><pubDate>Tue, 23 Sep 2008 06:28:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8961871</guid><dc:creator>PowerShellTeam</dc:creator><description>&lt;p&gt;@Andy:&lt;/p&gt;
&lt;p&gt;&amp;quot;Since this is surely True, that 'a' and 'A' are not equivalent ...&amp;quot;&lt;/p&gt;
&lt;p&gt;yes - I didn't make the point well (I've now updated the article). &amp;nbsp;The problem is that this is ALSO the case when you use -IEQ&lt;/p&gt;
&lt;p&gt;PS&amp;gt; [char]'a' -eq 'A'&lt;/p&gt;
&lt;p&gt;False&lt;/p&gt;
&lt;p&gt;PS&amp;gt; [char]'a' -ieq 'A'&lt;/p&gt;
&lt;p&gt;False&lt;/p&gt;
&lt;p&gt;&amp;lt;Update: &amp;nbsp;Notice that you get FALSE whether you use -eq (EQUALS) or -ieq (CASE INSENSITIVE EQUALS) &amp;gt;&lt;/p&gt;
&lt;p&gt;jps&lt;/p&gt;
</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8961924</link><pubDate>Tue, 23 Sep 2008 07:50:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8961924</guid><dc:creator>Joel "Jaykul" Bennett</dc:creator><description>&lt;p&gt;I say &amp;quot;fix&amp;quot; it.&lt;/p&gt;
&lt;p&gt;As a developer, I don't think it's really a bug to compare int values ... particularly when you're forcing the comparison of CHAR instead of string. You have to be really deliberate to get a char in PowerShell, so it should be obvious... &amp;nbsp;and my first inclination was to say leave it, but ...&lt;/p&gt;
&lt;p&gt;If you leave it, then the only option people have to get a case INsensitive comparison is a rather expensive conversion to strings ... whereas if you fix it, we can always deliberately say -ceq ...&lt;/p&gt;
&lt;p&gt;Also, consider the inconsistency of &lt;/p&gt;
&lt;p&gt;PS&amp;gt; [char]$c = &amp;quot;a&amp;quot;&lt;/p&gt;
&lt;p&gt;PS&amp;gt; switch($c) {&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt; &amp;quot;A&amp;quot; { &amp;quot;Big A&amp;quot; }&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt; &amp;quot;a&amp;quot; { &amp;quot;Little A&amp;quot; }&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt; }&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;&lt;/p&gt;
&lt;p&gt;Big A&lt;/p&gt;
&lt;p&gt;Little A&lt;/p&gt;
&lt;p&gt;PS&amp;gt; $c -eq &amp;quot;A&amp;quot;&lt;/p&gt;
&lt;p&gt;False&lt;/p&gt;
&lt;p&gt;... that's really trippy :)&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8961934</link><pubDate>Tue, 23 Sep 2008 08:11:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8961934</guid><dc:creator>Alex B Chalmers</dc:creator><description>&lt;p&gt;I can understand the dilemma, but my preference would be to move to the more readily apparent idiom where [char]'a' -ieq 'A' results in True.&lt;/p&gt;
&lt;p&gt;In a lower-level language, I could be more comfortable arguing that the v1 behavior is of value. &amp;nbsp;However, in PowerShell I've found such constructs to be more of a hindrance than produing more understandable and readable code. &amp;nbsp;Additionally, the fix for scripts written to make use of this issue is trivial (a simple cast to [int] will replicate this behavior).&lt;/p&gt;
&lt;p&gt;If the v1 behavior is allowed to remain, I would strongly urge for the removal of the -ieq operator for char, as it no longer would apply.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8961941</link><pubDate>Tue, 23 Sep 2008 08:28:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8961941</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Jeffrey,&lt;/p&gt;
&lt;p&gt;Compliments on the great product, with Powershell we really get the sense of power,&lt;/p&gt;
&lt;p&gt;now I always feel I can do the things I need to do, when before we regulary got stuck or had to fall back to calling 3rd party tools or creating awkward workarounds!&lt;/p&gt;
&lt;p&gt;My opinion about this issue:&lt;/p&gt;
&lt;p&gt;It's a bug, so it's probably better fixed in v2.0 then in version v5.0, and there will be lots more scripts broken by that time.&lt;/p&gt;
&lt;p&gt;It would probably help to document the change really well in the release notes.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8961956</link><pubDate>Tue, 23 Sep 2008 09:06:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8961956</guid><dc:creator>Domdomz</dc:creator><description>&lt;p&gt;If you want to fix it, make sure it is consistent.&lt;/p&gt;
&lt;p&gt;I would prefer to have [char] 'a' -eq 'a' being FALSE as [char] and [string] are like apple and pineapple ;-)))&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962017</link><pubDate>Tue, 23 Sep 2008 11:00:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962017</guid><dc:creator>nikb</dc:creator><description>&lt;p&gt;Its a bug its need fixing. I do agree with an earlier statement that if you don't fix it, it will haunt Powershell during its lifetime.&lt;/p&gt;
&lt;p&gt;Better to fix it now v2 than i v3 :-)&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962026</link><pubDate>Tue, 23 Sep 2008 11:16:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962026</guid><dc:creator>Johannes Rössel</dc:creator><description>&lt;p&gt;I find it hard to imagine that this behavious is something someone relies on. After all, it's easily worked around and thus I am strongly in favour of fixing it. As Adrian already pointed out, left this way it would be a language nightmare for the sake of compatibility just as many things in cmd are (and those are often a pain to work with).&lt;/p&gt;
&lt;p&gt;Oh, and it should be 'stakeholder' in the article, not 'stackholder', I think :-)&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962079</link><pubDate>Tue, 23 Sep 2008 12:35:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962079</guid><dc:creator>David Moravec</dc:creator><description>&lt;p&gt;As mentioned before, both -eq and -ieq has the same output for those four:&lt;/p&gt;
&lt;p&gt;[char]'a' -eq [char]'A'&lt;/p&gt;
&lt;p&gt; &amp;nbsp;False&lt;/p&gt;
&lt;p&gt;'a' -eq 'A'&lt;/p&gt;
&lt;p&gt; &amp;nbsp;True&lt;/p&gt;
&lt;p&gt;[char]'a' -eq 'A'&lt;/p&gt;
&lt;p&gt; &amp;nbsp;False&lt;/p&gt;
&lt;p&gt;'a' -eq [char]'A'&lt;/p&gt;
&lt;p&gt; &amp;nbsp;True&lt;/p&gt;
&lt;p&gt;&amp;lt;Ups, I dived deep into this - have full screen of -eq, -ieq, ceq :)&amp;gt;&lt;/p&gt;
&lt;p&gt;Frankly - I am a PowerSheller short time and till now haven't trouble with comparison (it worked as I expected). As I now tested really a lot of comparison, for me current state is OK. Maybe except points three and four in my examples - this is for me strange.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962093</link><pubDate>Tue, 23 Sep 2008 13:00:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962093</guid><dc:creator>n3llyb0y</dc:creator><description>&lt;p&gt;Fixing bugs is the best long term strategy. If I had (in some bizzare mental state) relied on this bug in a script then I would probably like the opportunity to address it.&lt;/p&gt;
&lt;p&gt;Knowing the details of the bug, surely it wouldn't be too much of a stretch to create a crawler to itterate through scripts and identify where this fix might break something.&lt;/p&gt;
&lt;p&gt;cheers (keep up the good work)&lt;/p&gt;
&lt;p&gt;n&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962118</link><pubDate>Tue, 23 Sep 2008 13:57:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962118</guid><dc:creator>JeremyG</dc:creator><description>&lt;p&gt;Clearly a bug and should be fixed.&lt;/p&gt;
&lt;p&gt;For the justification I will say that Powershell is still a very young language, and while this may create a couple of headaches right now.....imagine what it would be like if this stays the same for YEARS and becomes a quirk of the language.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962182</link><pubDate>Tue, 23 Sep 2008 15:29:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962182</guid><dc:creator>Mike</dc:creator><description>&lt;p&gt;IMO, I'd rather see the behavior consistent with string comparisons. If I need to treat a char like an int, I'll cast it that way.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962185</link><pubDate>Tue, 23 Sep 2008 15:32:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962185</guid><dc:creator>Mark</dc:creator><description>&lt;p&gt;I think this is clearly a bug and should be fixed.&lt;/p&gt;
&lt;p&gt;Not only is &lt;/p&gt;
&lt;p&gt; &amp;nbsp;PS&amp;gt; [char]'a' -ieq 'A'&lt;/p&gt;
&lt;p&gt; &amp;nbsp;False&lt;/p&gt;
&lt;p&gt;but&lt;/p&gt;
&lt;p&gt; &amp;nbsp;PS&amp;gt; [char]'a' -ieq [char]'A'&lt;/p&gt;
&lt;p&gt; &amp;nbsp;False&lt;/p&gt;
&lt;p&gt;IMO this behavior is simply wrong and should be fixed in PS. &amp;nbsp;&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962201</link><pubDate>Tue, 23 Sep 2008 15:50:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962201</guid><dc:creator>Xaegr</dc:creator><description>&lt;p&gt;I'm sure this is correct behavior and should not be &amp;quot;fixed&amp;quot;. [char] is special data type, different from [string], and it shouldnt be threated equally.&lt;/p&gt;
&lt;p&gt;No one will want to 97 be &amp;quot;equal&amp;quot; to 65, this is almost the same case.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962252</link><pubDate>Tue, 23 Sep 2008 16:53:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962252</guid><dc:creator>Elan</dc:creator><description>&lt;p&gt;Definitely a bug and should be fixed.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962292</link><pubDate>Tue, 23 Sep 2008 17:26:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962292</guid><dc:creator>Don Jones</dc:creator><description>&lt;p&gt;Fix it. This isn't the same as 97 being equal to 65; most people expect &amp;quot;a&amp;quot; to always be equal to &amp;quot;A&amp;quot; is case isn't a consideration.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962301</link><pubDate>Tue, 23 Sep 2008 17:40:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962301</guid><dc:creator>Jason Fossen</dc:creator><description>&lt;p&gt;[char]'a' -ieq 'A'&lt;/p&gt;
&lt;p&gt;This should eval to TRUE since it's what 90% of administrative scripters (the main target audience) would expect. &amp;nbsp;Even if more experienced C/C++/C# coders might expect otherwise, those coders will quickly find the issue in their scripts and accomodate; the admin scripters, on the other hand, are more likely to struggle and blame PowerShell/Microsoft for it (which hurts adoption of PowerShell).&lt;/p&gt;
&lt;p&gt;As for breaking scripts, I've done a ton of them and I doubt a single one would be broken by this change. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for asking the group! &amp;nbsp;Looking forward to PowerShell 2.0!&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962314</link><pubDate>Tue, 23 Sep 2008 17:51:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962314</guid><dc:creator>Chris Kuntz</dc:creator><description>&lt;p&gt;I say fix the bug. &amp;nbsp;Even though PowerShell is being adopted rapidly, when you get to tens of million active members fixing this issue will not be an option, due to the level of pain customers would experience.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962347</link><pubDate>Tue, 23 Sep 2008 18:13:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962347</guid><dc:creator>MikeDub</dc:creator><description>&lt;p&gt;Short Answer - Fix it&lt;/p&gt;
&lt;p&gt;Have to laugh..My bookmark in Bruce's book (PowerShell in Action) is actually on page 107. &amp;nbsp;Just a couple pages after the discussion on 'Comparisons and case-sensitivity.&lt;/p&gt;
&lt;p&gt;So, with that being said - it should be clear that I'm JUST getting started with PowerShell, as I would believe many are and will be soon. &amp;nbsp;Would rather see a fix in place before I really get into my PowerShell scripting.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962396</link><pubDate>Tue, 23 Sep 2008 19:00:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962396</guid><dc:creator>Jason Archer</dc:creator><description>&lt;p&gt;I would say that the -ieq result is a bug, but the -eq result is not.&lt;/p&gt;
&lt;p&gt;[char]'a' -eq 'A' &amp;nbsp;# This should return False (they are not the same)&lt;/p&gt;
&lt;p&gt;[char]'a' -ceq 'A' &amp;nbsp;# This should return False (they are not the same case)&lt;/p&gt;
&lt;p&gt;[char]'a' -ieq 'A' &amp;nbsp;# This should return True (they are the same letter, different case which we asked to ignore)&lt;/p&gt;
&lt;p&gt;This is the benefit of having explicitly cased comparisons. &amp;nbsp;If you want case sensitivity, you can have it. &amp;nbsp;If you don't want it, you can specify that too. &amp;nbsp;If there is a script expecting the above -ieq example to return false, then they should have recognized it as a bug.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962399</link><pubDate>Tue, 23 Sep 2008 19:03:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962399</guid><dc:creator>BoundedSpace</dc:creator><description>&lt;p&gt;Please, please fix this.&lt;/p&gt;
&lt;p&gt;Better to break a few scripts that depend on what is clearly a bug than have stange behaviour that all users might well be surprised by and will have to remember as an oddity.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962435</link><pubDate>Tue, 23 Sep 2008 19:25:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962435</guid><dc:creator>KenH</dc:creator><description>&lt;p&gt;I say fix it. &amp;nbsp;Keeping support for &amp;quot;legacy bugs&amp;quot; is a mistake, IMO.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962531</link><pubDate>Tue, 23 Sep 2008 20:47:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962531</guid><dc:creator>slipsec</dc:creator><description>&lt;p&gt;Fix it! &amp;nbsp;IMO one of the biggest problems with MS is the reluctance to fix _BUGS_ because they might break backwards compatibility. &amp;nbsp;If you want to work backwards, use the legacy product, or fix your scripts/apps to work with the newer *FIXED* edition. &amp;nbsp;Supporting old scripts is great, but at the price of preserving bugs? &amp;nbsp;I'm not even sure how this can be a question.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962577</link><pubDate>Tue, 23 Sep 2008 21:19:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962577</guid><dc:creator>mevi</dc:creator><description>&lt;p&gt;Another &amp;quot;fix it&amp;quot; vote.&lt;/p&gt;
&lt;p&gt;Legacy cruft and workarounds do not make for pleasurable experiences 15 years later when a new OS comes out that finally breaks the compatibility. &amp;nbsp;&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962592</link><pubDate>Tue, 23 Sep 2008 21:33:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962592</guid><dc:creator>abqbill</dc:creator><description>&lt;p&gt;Hi Jeffrey,&lt;/p&gt;
&lt;p&gt;Greetings from Albuquerque (we met at the IT Pro Townhall meeting dinner in April 2007). I want to echo Jason Fossen's comments, above. My opinion is that the v1 behavior is counterintuitive to the majority of your target audience. My experience is that non-developers tend to get frustrated more easily with these kinds of problems.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962649</link><pubDate>Tue, 23 Sep 2008 22:39:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962649</guid><dc:creator>Guy Ellis</dc:creator><description>&lt;p&gt;I think that it should be fixed so that:&lt;/p&gt;
&lt;p&gt;'a' -ieq 'A'&lt;/p&gt;
&lt;p&gt;returns true.&lt;/p&gt;
&lt;p&gt;There should be a cmdlet/function that gets the value of a character such as:&lt;/p&gt;
&lt;p&gt;CharVal('a') -ieq CharVal('A')&lt;/p&gt;
&lt;p&gt;returns false.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962701</link><pubDate>Tue, 23 Sep 2008 23:26:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962701</guid><dc:creator>Joshua</dc:creator><description>&lt;p&gt;It might break existing scripts but fix it anyway. &amp;nbsp;&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962736</link><pubDate>Wed, 24 Sep 2008 00:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962736</guid><dc:creator>Darren Gosbell</dc:creator><description>&lt;p&gt;Fix it.&lt;/p&gt;
&lt;p&gt;This bug breaks one of Powershell's great strengths, which is it's consistency. &lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962799</link><pubDate>Wed, 24 Sep 2008 01:18:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962799</guid><dc:creator>Eric Lee</dc:creator><description>&lt;p&gt;Like most people, I vote for fixing it. &amp;nbsp;Backwards compatibility is nice in the short-term but it's pure evil in the long-term. &amp;nbsp;There's no reason why everyone should have to live with this bug *forever*. &amp;nbsp;Just take the hit now and fix it.&lt;/p&gt;
&lt;p&gt;Of course, I'm not the one who's going to have broken scripts, so take that for what it's worth. &amp;nbsp;:-)&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962868</link><pubDate>Wed, 24 Sep 2008 02:21:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962868</guid><dc:creator>Bruno Gomes</dc:creator><description>&lt;p&gt;As some people have pointed out (and I think this should be made clearer in the post, Jeffrey), we have a huge inconsistency here:&lt;/p&gt;
&lt;p&gt;PS&amp;gt; 'a' -eq [char]'A'&lt;/p&gt;
&lt;p&gt;True&lt;/p&gt;
&lt;p&gt;PS&amp;gt; [char]'A' -eq 'a'&lt;/p&gt;
&lt;p&gt;False&lt;/p&gt;
&lt;p&gt;If A equals B, B should always equal A, no matter what. So it IS a bug and it SHOULD be fixed.&lt;/p&gt;
&lt;p&gt;Now comes the second part: in .NET, when you compare a Char with a String, the result is always False. I agree with Domdomz when he says that [char] and [string] are like apple and pineapple. Even though Powershell does and should continue doing a lot of things under the hood to make things easier for everyone, I don't think it should automatically compare Chars with Strings (unless someone comes up with a good example of why that would be useful).&lt;/p&gt;
&lt;p&gt;So, my opinion is: it MUST be fixed, but String and Char comparisons should return False.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962908</link><pubDate>Wed, 24 Sep 2008 03:17:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962908</guid><dc:creator>David Moisan</dc:creator><description>&lt;p&gt;I say &amp;quot;fix it!&amp;quot; &amp;nbsp;People are using the example &amp;quot;A&amp;quot; -eq &amp;quot;a&amp;quot;, but we know very well that's not how the comparison will happen in real life.&lt;/p&gt;
&lt;p&gt;It'll be more like:&lt;/p&gt;
&lt;p&gt;$fileA -eq $FileB&lt;/p&gt;
&lt;p&gt;where $fileA is = &amp;quot;rundll.exe&amp;quot; and $FileB is &lt;/p&gt;
&lt;p&gt;&amp;quot;RUNDLL.EXE&amp;quot;.&lt;/p&gt;
&lt;p&gt;And *that* will be confusing, the sort of thing that Linux advocates will crow about for years.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962915</link><pubDate>Wed, 24 Sep 2008 03:25:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962915</guid><dc:creator>Cullen</dc:creator><description>&lt;p&gt;The argument that a [char] and a [string] should always be unequal is absurd in context - would you argue that an [int] and a [double] are similarly dissimilar, and that:&lt;/p&gt;
&lt;p&gt;1.0 -eq 1&lt;/p&gt;
&lt;p&gt;should be false? &amp;nbsp;What about comparing a [double] and a [string]?&lt;/p&gt;
&lt;p&gt;&amp;quot;1&amp;quot; -eq 1.0&lt;/p&gt;
&lt;p&gt;IMHO, both [char] and [string] are different forms of [text], and thus case insensitive amd sensitive comparisons should be valid.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8962988</link><pubDate>Wed, 24 Sep 2008 05:07:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962988</guid><dc:creator>Hal Rottenberg</dc:creator><description>&lt;p&gt;Dang...a ton of comments on this post.&lt;/p&gt;
&lt;p&gt;I fall on the &amp;quot;[char]'a' -ieq 'A'&lt;/p&gt;
&lt;p&gt;This should eval to TRUE since it's what 90% of administrative scripters (the main target audience) would expect.&amp;quot; side of the fence.&lt;/p&gt;
&lt;p&gt;Fix it.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8963257</link><pubDate>Wed, 24 Sep 2008 09:31:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8963257</guid><dc:creator>Keith Hill</dc:creator><description>&lt;p&gt;Yep, fix it. &amp;nbsp;Just make sure that this behavior change is well documented in the release notes. &amp;nbsp;It might be nice to have a PowerShell.exe switch that would flag use of changed functionality within a script that could potentially break the script. &lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8963340</link><pubDate>Wed, 24 Sep 2008 11:16:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8963340</guid><dc:creator>Cedric</dc:creator><description>&lt;p&gt;Yes, Fix it...&lt;/p&gt;
&lt;p&gt;With a &amp;quot;big&amp;quot; warning in release notes ;). It's most important to fix bug that to be compatible with old script that take advantage of a bug. I think the most important is that the &amp;quot;work around&amp;quot; found by some of us (if any) still works...&lt;/p&gt;
&lt;p&gt;Regards!&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8963505</link><pubDate>Wed, 24 Sep 2008 14:18:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8963505</guid><dc:creator>Bruno Gomes</dc:creator><description>&lt;p&gt;I'm not trying to start a flame war here, so let's all relax =).&lt;/p&gt;
&lt;p&gt;Let me explain why I think a [char] and a [string] comparison should return false...&lt;/p&gt;
&lt;p&gt;1- Powershell is built upon .NET and that's how it works there.&lt;/p&gt;
&lt;p&gt;&amp;quot;But, but... Powershell is a scripting language and it doesn't have to follow all the stupid rules of this lower level platform! It should make things easier for the scripters out there!&amp;quot;&lt;/p&gt;
&lt;p&gt;Which I would reply to with:&lt;/p&gt;
&lt;p&gt;2- Yes, you are right. Powershell should make things easier for everyone (and it does), but making chars equal to strings would not simplify things, in my opinion. Visually, it is compelling to say: [char]'a' is just like 'a', of course they should be equal... They represent the same thing.&lt;/p&gt;
&lt;p&gt;But chars don't appear in code like that. They are almost exclusively the return of some method call, like 'string'.ToCharArray(). The only counter intuitive comparison a scripter could face (at least that I can think of) is the &amp;quot;[char]'a' -eq 'a'&amp;quot; example, which, as I said, probably won't be seen in real world scripts. &lt;/p&gt;
&lt;p&gt;3- Powershell already treats [char] and [string] differently. When they tried to do too much (making them equal), guess what happened? =) &lt;/p&gt;
&lt;p&gt;Let's say 'a' -eq [char]'a' should return $True. In the following code, what should the last line return?&lt;/p&gt;
&lt;p&gt;PS&amp;gt; $string = 'a'; $char = [char]'a'&lt;/p&gt;
&lt;p&gt;PS&amp;gt; [int]$string -eq [int]$char&lt;/p&gt;
&lt;p&gt;In a perfect world, chars and strings should be equal, and all design decisions are easy... But Powershell IS built upon .NET, so maybe it should follow some of their rules, when it's not possible to break them.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8963755</link><pubDate>Wed, 24 Sep 2008 19:03:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8963755</guid><dc:creator>Cash Foley</dc:creator><description>&lt;p&gt;Fix the bug. &amp;nbsp;If it's not too awkward, provide a switch that can be configured or set in a script for backwards compatibility.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8963765</link><pubDate>Wed, 24 Sep 2008 19:12:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8963765</guid><dc:creator>Cash Foley</dc:creator><description>&lt;p&gt;Bruno,&lt;/p&gt;
&lt;p&gt;Powershell is fundamentally different than C# in the way it 'auto converts' types. &amp;nbsp;Making Powershell more 'internally consistent' is what makes sense for Powershell.&lt;/p&gt;
&lt;p&gt;It would have been wrong for C# to have worked the proposed Powershell way. &amp;nbsp;It's not 'internally consistent' with strong typing.&lt;/p&gt;
&lt;p&gt;Second, language semantics are different than &amp;quot;built on .Net&amp;quot;. &amp;nbsp;There are considerable differences between VB.net and C# and both are built on .Net&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8963869</link><pubDate>Wed, 24 Sep 2008 20:20:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8963869</guid><dc:creator>Jay Bazuzi</dc:creator><description>&lt;p&gt;Please fix it! &amp;nbsp;The sooner the better.&lt;/p&gt;
&lt;p&gt;You're worried about the number of scripts out there today that could be broken, but think how many more scripts there will be in 10 years. &amp;nbsp;Save the future from the present!&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8964083</link><pubDate>Thu, 25 Sep 2008 00:11:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8964083</guid><dc:creator>Staffan Gustafsson</dc:creator><description>&lt;p&gt;Fix it.&lt;/p&gt;
&lt;p&gt;Better to fix a few scripts now, that to live with the inconsistency for eternity.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8964154</link><pubDate>Thu, 25 Sep 2008 01:10:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8964154</guid><dc:creator>Ken Taylor</dc:creator><description>&lt;p&gt;I vote fix it. It's still pretty early in the grand scheme of things.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8966145</link><pubDate>Fri, 26 Sep 2008 11:30:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8966145</guid><dc:creator>Stefan Falk</dc:creator><description>&lt;p&gt;Hello everybody,&lt;/p&gt;
&lt;p&gt;I think you should fix it, but not the way you are suggesting. Strong typing inherently means to me that a char is NOT an int. A char is a char, and an int is an int. You can convert one to the other, but they are not the same. So [char]'A' -eq 65 should be false in my opinion (if it not even throws some kind of type mismatch error). Thus, [char]'a' -eq 'a' should be false also, as a char IS NOT a string, and never will be. The benefits of (very) strong typing extend well into the scripting world in my opinion.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Stefan Falk&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8966479</link><pubDate>Fri, 26 Sep 2008 17:01:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8966479</guid><dc:creator>Hans Meiser</dc:creator><description>&lt;p&gt;Fix this bug asap and change the file extension from ps1 to ps2. It is much easier to change the file extension than adding &amp;quot;reqires version 2&amp;quot; on each and every new script.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8967075</link><pubDate>Sat, 27 Sep 2008 00:37:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8967075</guid><dc:creator>karl prosser</dc:creator><description>&lt;p&gt;i say fix it, but have some sort of &amp;quot;strict&amp;quot; mode, or a function that can peruse a script and point out possible compatibility issues such as this.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8968115</link><pubDate>Sun, 28 Sep 2008 20:20:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8968115</guid><dc:creator>Karl</dc:creator><description>&lt;p&gt;[char]'a' -ieq 'A' &amp;nbsp;should get fixed even if there are body of scripts coded to the old behavior. &lt;/p&gt;
&lt;p&gt;You can soften the blow with compiler modes or 'depricated' warnings.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8968339</link><pubDate>Mon, 29 Sep 2008 04:48:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8968339</guid><dc:creator>Poshoholic</dc:creator><description>&lt;p&gt;Definitely fix it! &amp;nbsp;This is one of those issues that makes people like me use char objects a lot less (if ever) simply because they don't work as I would expect them to with the standard operators.&lt;/p&gt;
&lt;p&gt;If you do the right thing and fix this, please, please, please don't forget this: the contains operator is also broken for char arrays and should have a similar fix applied so that you can properly find out of a character array contains a specific character or not using case-sensitive and case-insensitive comparisons. &amp;nbsp;This is also broken and very inconsistent in PowerShell, enough so that I don't use character arrays anymore at all because of this issue in v1.&lt;/p&gt;
&lt;p&gt;[179] PS↑ C:\&amp;gt; [char[]]'abcde' -contains 'a'&lt;/p&gt;
&lt;p&gt;True&lt;/p&gt;
&lt;p&gt;[180] PS↑ C:\&amp;gt; [char[]]'abcde' -icontains 'a'&lt;/p&gt;
&lt;p&gt;True&lt;/p&gt;
&lt;p&gt;[181] PS↑ C:\&amp;gt; [char[]]'abcde' -ccontains 'a'&lt;/p&gt;
&lt;p&gt;True # this should be False&lt;/p&gt;
&lt;p&gt;[182] PS↑ C:\&amp;gt; [char[]]'abcde' -contains 'A'&lt;/p&gt;
&lt;p&gt;False # this should be True&lt;/p&gt;
&lt;p&gt;[183] PS↑ C:\&amp;gt; [char[]]'abcde' -icontains 'A'&lt;/p&gt;
&lt;p&gt;False # this should be True&lt;/p&gt;
&lt;p&gt;[184] PS↑ C:\&amp;gt; [char[]]'abcde' -ccontains 'A'&lt;/p&gt;
&lt;p&gt;False&lt;/p&gt;
&lt;p&gt;--&lt;/p&gt;
&lt;p&gt;Kirk Munro [MVP]&lt;/p&gt;
&lt;p&gt;Poshoholic&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://poshoholic.com"&gt;http://poshoholic.com&lt;/a&gt;&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8968909</link><pubDate>Mon, 29 Sep 2008 16:53:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8968909</guid><dc:creator>Poshoholic</dc:creator><description>&lt;p&gt;Sorry, one typo in my last comment. &amp;nbsp;The # this should be False comment shouldn't be there. &amp;nbsp;Copy/paste bug. :P&lt;/p&gt;
&lt;p&gt;Anyhow, the point is the same regardless. &amp;nbsp;-contains needs the same attention for [char[]] as -eq does for [char].&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8969248</link><pubDate>Mon, 29 Sep 2008 20:19:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8969248</guid><dc:creator>dreeschkind</dc:creator><description>&lt;p&gt;My opinion: fix this anyway!&lt;/p&gt;
&lt;p&gt;If old scripts break one should always be able to run them using PowerShell V1. PowerShell V2 should have PS2 file extension anyway. Languages will always change.&lt;/p&gt;
&lt;p&gt;--&lt;/p&gt;
&lt;p&gt;greetings&lt;/p&gt;
&lt;p&gt;dreeschkind&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8969562</link><pubDate>Tue, 30 Sep 2008 01:50:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8969562</guid><dc:creator>Stuart Henderson</dc:creator><description>&lt;p&gt;Definitely fix it. Jaykuls 'switch' example provides a 100% convincing argument as I see it.&lt;/p&gt;
&lt;p&gt;If you don't fix it now more scripts will be written, thus increasing the surface area for pain when the issue resurfaces in the future.&lt;/p&gt;
&lt;p&gt;Just my $00.02&lt;/p&gt;
&lt;p&gt;Stuart&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8969975</link><pubDate>Tue, 30 Sep 2008 10:38:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8969975</guid><dc:creator>Maximilian Hänel</dc:creator><description>&lt;p&gt;I absolutly agree with dreeschkind. Change the file extension to ps2 and fix the bug. &lt;/p&gt;
&lt;p&gt;I can't repeat it often enough: Change the file extension!&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8970555</link><pubDate>Tue, 30 Sep 2008 21:08:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8970555</guid><dc:creator>bschneid</dc:creator><description>&lt;p&gt;IMHO, this is a bug and should be addressed. If types are defined then you should get what you ask for:&lt;/p&gt;
&lt;p&gt;[char]'A' -ceq [int]65 &amp;nbsp; [evaluates True](Valid)&lt;/p&gt;
&lt;p&gt;[char]'a' -ceq [int]97 &amp;nbsp; [evaluates True](Valid)&lt;/p&gt;
&lt;p&gt;[char]'A' -ieq [char]'a' [evaluates False](Valid: 65 != 97)&lt;/p&gt;
&lt;p&gt;I agree with Bruno Gomes about if a=b then b=a. Which this example shows does not work here:&lt;/p&gt;
&lt;p&gt;[string]'a' -ieq [char]'A' [evaluates True]&lt;/p&gt;
&lt;p&gt;[char]'A' -ieq [string]'a' [evaluates False]&lt;/p&gt;
&lt;p&gt;However, both should evaluate as False as String and Char types should not be equal. And for that matter, the following should evaluate as false:&lt;/p&gt;
&lt;p&gt;[string]'a' -eq [char]'a' [evaluates True]&lt;/p&gt;
&lt;p&gt;[char]'a' -eq [string]'a' [evaluates True]&lt;/p&gt;
&lt;p&gt;If a script doesn't define types, then this is all that is required:&lt;/p&gt;
&lt;p&gt;'a' -ceq 'A' [evaluates False]&lt;/p&gt;
&lt;p&gt;'a' -ieq 'A' [evaluates True]&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#8986435</link><pubDate>Tue, 07 Oct 2008 21:17:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8986435</guid><dc:creator>Mark Ross</dc:creator><description>&lt;p&gt;This should be fixed. &amp;nbsp;Chars should be chars, not some cute way to refer to an int.&lt;/p&gt;
&lt;p&gt;This looks like a holdover to the c language where just about everything could be interpreted as an int. &amp;nbsp;You don't intend PowerShell to become c, do you? &amp;nbsp;PLEASE say no.&lt;/p&gt;
&lt;p&gt;c was (is) a fine language for those who can handle it properly. &amp;nbsp;But, that doesn't mean every language that comes after must emulate it. &amp;nbsp;There are plenty of quirks in c that would be much better left behind.&lt;/p&gt;
&lt;p&gt;I repeat - chars should be chars with their own existence and behavior quite outside of any other data type. &amp;nbsp;Fix it and let the scripts break. &amp;nbsp;It's the right thing to do.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#9002326</link><pubDate>Fri, 17 Oct 2008 00:01:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9002326</guid><dc:creator>Rainer Böhme</dc:creator><description>&lt;p&gt;Fix it!&lt;/p&gt;
&lt;p&gt;I'm not sure if any user at all considered this as a feature and used it.&lt;/p&gt;
&lt;p&gt;If you're still worried about backward compatibility then put in an option to switch on a &amp;quot;1.0 compatibility mode&amp;quot;, as a command line option or environment variable.&lt;/p&gt;
&lt;p&gt;This might be even more useful if there are other compatibility breaking changes in 2.0.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#9005448</link><pubDate>Sun, 19 Oct 2008 00:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9005448</guid><dc:creator>Anders Haahr</dc:creator><description>&lt;p&gt;I don't think you should emphasize backwards compatibility in this case.&lt;/p&gt;
&lt;p&gt;If char 'a' and 'A' both are converted to the same integer something is contraintuitive anyway (I'd expect one to be 65 and the other 97 - flipping the 6th bit was the way to change case on ascii characters).&lt;/p&gt;
&lt;p&gt;If it break scripts then ship the 2.0 release with a clear warning that users should read the changelog and then maybe also ship a script that can browse a folder and find scripts that has the problem.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#9010303</link><pubDate>Tue, 21 Oct 2008 23:17:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9010303</guid><dc:creator>Stephen Mills</dc:creator><description>&lt;p&gt;I say fix it as well. &amp;nbsp;Some people say that a char should never be the same as a string, but from an admin point of view that makes no sense. &amp;nbsp;How about the example:&lt;/p&gt;
&lt;p&gt;[char]'a' -ieq (([string]'A')[0])&lt;/p&gt;
&lt;p&gt;False&lt;/p&gt;
&lt;p&gt;(([string]'A')[0]).gettype()&lt;/p&gt;
&lt;p&gt;Name: Char&lt;/p&gt;
&lt;p&gt;A string can be referenced by the array operator, which in turn returns a Char. In this case I did not explicitly cast it as a Char, but still got a Char result from a String source. &amp;nbsp;So it doesn't make sense to me to say they can't be compared, especially when a char appears to be an element in a string.&lt;/p&gt;</description></item><item><title>re: Decision Input Requested:  -EQ with Characters </title><link>http://blogs.msdn.com/powershell/archive/2008/09/23/decision-input-requested-eq-with-characters.aspx#9019935</link><pubDate>Tue, 28 Oct 2008 12:04:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9019935</guid><dc:creator>Fancyf</dc:creator><description>&lt;p&gt;Fix it. My opinion is do the right thing. If one thing is wrong, correct it.&lt;/p&gt;</description></item></channel></rss>