{"id":9951,"date":"2006-07-21T03:51:00","date_gmt":"2006-07-21T03:51:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2006\/07\/21\/setting-the-console-title-to-be-your-current-working-directory\/"},"modified":"2019-02-18T13:21:31","modified_gmt":"2019-02-18T20:21:31","slug":"setting-the-console-title-to-be-your-current-working-directory","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/setting-the-console-title-to-be-your-current-working-directory\/","title":{"rendered":"Setting  the console title to be your current working directory"},"content":{"rendered":"<p>jmanning wrote:<\/p>\n<blockquote>\n<p><em>Also, given how common the request is, I&#8217;d ask Jeffrey to (pretty-please) also include in this post a prompt function that sets the title to include pwd. <br \/><\/em><\/p>\n<\/blockquote>\n<p>Ask and yea shall receive: <\/p>\n<p><font face=\"Courier New\" size=\"1\">function Prompt<br \/>{<br \/>&nbsp; $host.ui.RawUI.WindowTitle = $(get-location)<br \/>&nbsp; &#8220;PS&gt; &#8220;<br \/>}<\/font><\/p>\n<p>If you want to see a bunch of great prompt examples, check out:<\/p>\n<p><a href=\"http:\/\/mshforfun.blogspot.com\/2006\/05\/perfect-prompt-for-windows-powershell.html\">http:\/\/mshforfun.blogspot.com\/2006\/05\/perfect-prompt-for-windows-powershell.html<\/a><\/p>\n<p>Jeffrey Snover [MSFT]<br \/>Windows PowerShell\/Aspen Architect<br \/>Visit the Windows PowerShell Team blog at:&nbsp;&nbsp;&nbsp; <a href=\"http:\/\/blogs.msdn.com\/PowerShell\">http:\/\/blogs.msdn.com\/PowerShell<\/a><br \/>Visit the Windows PowerShell ScriptCenter at:&nbsp; <a href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/msh.mspx\">http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/msh.mspx<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>PSMDTAG:FAQ:&nbsp; How do I set the Console Title to my current working directory?<\/p>\n<p>PSMDTAG:SHELL: Prompt <\/p>\n<p>PSMDTAG:ENVIRONMENT: Prompt<\/p>\n","protected":false},"excerpt":{"rendered":"<p>jmanning wrote: Also, given how common the request is, I&#8217;d ask Jeffrey to (pretty-please) also include in this post a prompt function that sets the title to include pwd. Ask and yea shall receive: function Prompt{&nbsp; $host.ui.RawUI.WindowTitle = $(get-location)&nbsp; &#8220;PS&gt; &#8220;} If you want to see a bunch of great prompt examples, check out: http:\/\/mshforfun.blogspot.com\/2006\/05\/perfect-prompt-for-windows-powershell.html [&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":[29,10,58,21],"class_list":["post-9951","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-environment","tag-faq","tag-prompt-function","tag-shell"],"acf":[],"blog_post_summary":"<p>jmanning wrote: Also, given how common the request is, I&#8217;d ask Jeffrey to (pretty-please) also include in this post a prompt function that sets the title to include pwd. Ask and yea shall receive: function Prompt{&nbsp; $host.ui.RawUI.WindowTitle = $(get-location)&nbsp; &#8220;PS&gt; &#8220;} If you want to see a bunch of great prompt examples, check out: http:\/\/mshforfun.blogspot.com\/2006\/05\/perfect-prompt-for-windows-powershell.html [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/9951","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=9951"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/9951\/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=9951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=9951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=9951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}