{"id":348,"date":"2006-12-06T04:00:00","date_gmt":"2006-12-06T12:00:00","guid":{"rendered":"http:\/\/testblog.sapien.com\/index.php\/2006\/12\/06\/tip-cli-to-powershell\/"},"modified":"2006-12-06T04:00:00","modified_gmt":"2006-12-06T12:00:00","slug":"tip-cli-to-powershell","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2006\/12\/06\/tip-cli-to-powershell\/","title":{"rendered":"Tip: CLI to PowerShell"},"content":{"rendered":"<p>If you have PowerShell installed (and if you don&#8217;t what are you waiting for?) you may be used to starting PowerShell from the Start Menu shortcut. But that&#8217;s not the only way.&nbsp; If you&#8217;re like me and always have a command prompt window open, you can easily launch PowerShell simply by running the command: powershell.<\/p>\n<p>That&#8217;s great but not good enough for me.&nbsp; I want visual cues that I now have a PowerShell session open.<\/p>\n<p>I can achieve this by setting the command prompt window&#8217;s color and title by using the COLOR and TITLE commands. I can make the changes and start PowerShell with a single command which I&#8217;ve put in a batch file I call posh.bat.<\/p>\n<p><span style=\"font-family: Courier New,Courier,mono;\">@echo off<\/span><br style=\"font-family: Courier New,Courier,mono;\"><span style=\"font-family: Courier New,Courier,mono;\">title Microsoft Windows Powershell &amp;&amp; color 9f &amp;&amp; powershell -nologo &amp; color &amp;&amp; <\/span><span style=\"font-family: Courier New,Courier,mono;\">title Command Prompt<\/span><\/p>\n<p>At a command prompt, when I run posh.bat the windows changes to a blue background with white text and the title bar changes to Microsoft Windows Powershell. You&#8217;ve probably noticed the Color and Title commands at the end of the expression.&nbsp; When I&#8217;m finished with PowerShell and type exit, these commands are run and returns my command prompt to its original state.<\/p>\n<p>Now you can save a few clicks and keystrokes and quickly get to work in PowerShell.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have PowerShell installed (and if you don&#8217;t what are you waiting for?) you may be used to starting PowerShell from the Start Menu shortcut. But that&#8217;s not the only way.<\/p>\n","protected":false},"author":3,"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":[18,2,25],"tags":[],"class_list":["post-348","post","type-post","status-publish","format-standard","hentry","category-batchcmd","category-general","category-windows-powershell"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/348","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\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=348"}],"version-history":[{"count":0,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/348\/revisions"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=348"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=348"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}