{"id":792,"date":"2008-03-23T13:29:41","date_gmt":"2008-03-23T21:29:41","guid":{"rendered":"http:\/\/www.scriptinganswers.com\/essentials\/index.php\/2008\/03\/23\/single-quotes-not-double\/"},"modified":"2008-11-04T09:06:07","modified_gmt":"2008-11-04T17:06:07","slug":"single-quotes-not-double","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2008\/03\/23\/single-quotes-not-double\/","title":{"rendered":"Single quotes, not double"},"content":{"rendered":"<p>Use &#8216;single quotation marks&#8217; around string literals unless you explicitly need variable expansion.  In PowerShell, single quotes are not expanded into variables:<\/p>\n<p style=\"margin-left: 40px; \">$var = &#8216;Hello&#8217;<\/p>\n<p>$result = &#8216;$var $var&#8217;<\/p>\n<p># $result contains &#8216;$var $var&#8217;<\/p>\n<p>Double quotes are:<\/p>\n<p style=\"margin-left: 40px; \">$var = &#8216;Hello&#8217;<\/p>\n<p>$result = &#8220;$var $var&#8221;<\/p>\n<p># $result contains &#8216;Hello Hello&#8217;<\/p>\n<p>To avoid unintended variable expansion, use single quotes unless you explicitly need the expansion feature.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Use &#8216;single quotation marks&#8217; around string literals unless you explicitly need variable expansion. In PowerShell, single quotes are not expanded into variables: $var = &#8216;Hello&#8217; $result = &#8216;$var $var&#8217; # $result contains &#8216;$var $var&#8217; Double quotes are: $var = &#8216;Hello&#8217; $result = &#8220;$var $var&#8221; # $result contains &#8216;Hello Hello&#8217; To avoid unintended variable expansion, use [&hellip;]<\/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":[283,25],"tags":[352,28,385],"class_list":["post-792","post","type-post","status-publish","format-standard","hentry","category-howto","category-windows-powershell","tag-double-quotes","tag-powershell","tag-single-quotes"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/792","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=792"}],"version-history":[{"count":1,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/792\/revisions"}],"predecessor-version":[{"id":824,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/792\/revisions\/824"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}