{"id":11001,"date":"2006-04-25T12:17:39","date_gmt":"2006-04-25T12:17:39","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2006\/04\/25\/did-you-know-1\/"},"modified":"2019-02-18T13:25:09","modified_gmt":"2019-02-18T20:25:09","slug":"did-you-know-1","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/did-you-know-1\/","title":{"rendered":"Did you know? #1"},"content":{"rendered":"<p>Did you know that you can access the content of a provider using the variable syntax?<\/p>\n<p>For instance, you can get and set the contents of a file just by doing the following:<br \/>MSH &gt; ${c:\\temp\\foo.txt} = &#8220;bar&#8221;<br \/>MSH &gt; ${c:\\temp\\foo.txt}<br \/>bar<br \/>MSH &gt;<\/p>\n<p>Note, the default encoding is used when setting the content in the filesystem in this way.<\/p>\n<p>Any provider that supports the IContentCmdletProvider interface can be accessed in this way.<\/p>\n<p>-Jeff Jones<\/p>\n<p>[<i>Edit: Monad has now been renamed to Windows PowerShell.  This script or discussion may require slight adjustments before it applies directly to newer builds.<\/i>]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Did you know that you can access the content of a provider using the variable syntax? For instance, you can get and set the contents of a file just by doing the following:MSH &gt; ${c:\\temp\\foo.txt} = &#8220;bar&#8221;MSH &gt; ${c:\\temp\\foo.txt}barMSH &gt; Note, the default encoding is used when setting the content in the filesystem in this [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-11001","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"blog_post_summary":"<p>Did you know that you can access the content of a provider using the variable syntax? For instance, you can get and set the contents of a file just by doing the following:MSH &gt; ${c:\\temp\\foo.txt} = &#8220;bar&#8221;MSH &gt; ${c:\\temp\\foo.txt}barMSH &gt; Note, the default encoding is used when setting the content in the filesystem in this [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/11001","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=11001"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/11001\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=11001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=11001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=11001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}