{"id":175,"date":"2007-07-31T01:07:25","date_gmt":"2007-07-31T09:07:25","guid":{"rendered":"http:\/\/testblog.sapien.com\/index.php\/2007\/07\/31\/sensitive-operators\/"},"modified":"2007-07-31T01:07:25","modified_gmt":"2007-07-31T09:07:25","slug":"sensitive-operators","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2007\/07\/31\/sensitive-operators\/","title":{"rendered":"Sensitive Operators"},"content":{"rendered":"<p>I&#8217;ve been playing with PowerShell&#8217;s operators a lot this week&#8230; one thing I&#8217;m sure you&#8217;ve noticed is that operators like -eq, -match, and -like are all case-insensitive. By default, PowerShell is pretty insensitive throughout the shell, which means you can be a bit lazy. &#8220;Don&#8221; is the same as &#8220;don&#8221; is the same as &#8220;DON&#8221; and so forth.<\/p>\n<p>But there are times when you might want PowerShell to be a bit more sensitive. And in those cases, there are always the case-sensitive operators:<\/p>\n<ul>\n<li>&nbsp;-ceq<\/li>\n<li>-cne<\/li>\n<li>-cle<\/li>\n<li>-cge<\/li>\n<li>-cgt<\/li>\n<li>-clt<\/li>\n<li>-cmatch<\/li>\n<li>-cnotmatch<\/li>\n<li>-clike<\/li>\n<\/ul>\n<p>And so forth&#8230; run <span style=\"font-weight: bold;\">help about_operator*<\/span> for more details and the complete. And, if you want to make it clear in a script or one-liner that you don&#8217;t <span style=\"font-style: italic;\">care<\/span> about case, you can use the explicit case insensitive operators: -ieq, -imatch, -inotmatch, -ilike, and their friends. Sadly, there is no -ipod operator, although perhaps we&#8217;ll see a -zune operator in PowerShell v2.<\/p>\n<p>So go forth and make PowerShell as sensitive as you like.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been playing with PowerShell&#8217;s operators a lot this week&#8230; one thing I&#8217;m sure you&#8217;ve noticed is that operators like -eq, -match, and -like are all case-insensitive. By default, PowerShell is pretty insensitive throughout the shell, which means you can be a bit lazy. &#8220;Don&#8221; is the same as &#8220;don&#8221; is the same as &#8220;DON&#8221; and so forth.<\/p>\n<p>But there are times when you might want PowerShell to be a bit more sensitive. And in those cases, there are always the case-sensitive operators:<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[25],"tags":[],"class_list":["post-175","post","type-post","status-publish","format-standard","hentry","category-windows-powershell"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=175"}],"version-history":[{"count":0,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/175\/revisions"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}