{"id":71872,"date":"2015-07-28T11:59:00","date_gmt":"2015-07-28T11:59:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2015\/07\/28\/powertip-read-file-with-backtick-in-name\/"},"modified":"2019-02-18T09:46:49","modified_gmt":"2019-02-18T16:46:49","slug":"powertip-read-file-with-backtick-in-name","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-read-file-with-backtick-in-name\/","title":{"rendered":"PowerTip: Read File with Backtick in Name"},"content":{"rendered":"<p><b style=\"font-size:12px\">Summary<\/b><span style=\"font-size:12px\">: Read the content of a text file with a backtick ( ` ) in the name.<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/>&nbsp;How can I use Windows PowerShell to read the content of a file that has a backtick (<b>&nbsp;`<\/b>&nbsp;) in the file name?<\/p>\n<p style=\"margin-left:30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/>&nbsp;Use single quotation marks around the name when you supply the path to&nbsp;<b>Get-Content<\/b>, for example:<\/p>\n<p style=\"margin-left:120px\">Get-Content &#039;c:\\fso\\a file with a `in the name.txt&#039;<\/p>\n<p style=\"margin-left:60px\">The following examples fail:<\/p>\n<p style=\"margin-left:120px\">Get-Content &quot;c:\\fso\\a file with a `in the name.txt&quot;<\/p>\n<p style=\"margin-left:120px\">Get-Content c:\\fso\\a file with a `in the name.txt<\/p>\n<p style=\"margin-left:30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7610.Dr.ScriptoForTips.jpg\" alt=\" \" \/><\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Read the content of a text file with a backtick ( ` ) in the name. &nbsp;How can I use Windows PowerShell to read the content of a file that has a backtick (&nbsp;`&nbsp;) in the file name? &nbsp;Use single quotation marks around the name when you supply the path to&nbsp;Get-Content, for example: Get-Content [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[51,356,3,45],"class_list":["post-71872","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-getting-started","tag-powertip","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Read the content of a text file with a backtick ( ` ) in the name. &nbsp;How can I use Windows PowerShell to read the content of a file that has a backtick (&nbsp;`&nbsp;) in the file name? &nbsp;Use single quotation marks around the name when you supply the path to&nbsp;Get-Content, for example: Get-Content [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/71872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=71872"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/71872\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=71872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=71872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=71872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}