{"id":1352,"date":"2009-04-17T06:00:29","date_gmt":"2009-04-17T14:00:29","guid":{"rendered":"http:\/\/www.sapien.com\/blog\/2009\/04\/17\/fun-with-powershell-ise\/"},"modified":"2009-04-17T06:00:29","modified_gmt":"2009-04-17T14:00:29","slug":"fun-with-powershell-ise","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2009\/04\/17\/fun-with-powershell-ise\/","title":{"rendered":"Fun with PowerShell ISE"},"content":{"rendered":"<p>A popular PowerShell version 2 feature is the graphical PowerShell console, known as the Integrated Script Environment or ISE. The ISE has its own object model which means you can customize it. Here a few things you might want to tweak, or at least experiment with.&nbsp; <\/p>\n<p>First, open the ISE and in the command panel type: <\/p>\n<p><font face=\"Lucida Console\" color=\"#0000ff\" size=\"1\">$psise.options<\/font><\/p>\n<p>You should get output like this.<\/p>\n<p><font face=\"Lucida Console\" color=\"#0000ff\" size=\"1\">SelectedScriptPaneState&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Top<br \/>ShowToolBar&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<br \/>TokenColors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : {[Attribute, #FFADD8E6], [Command, #FF0000FF], <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [CommandArgument, #FF8A2BE2], [CommandParameter<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , #FF000080]&#8230;}<br \/>DefaultOptions&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Microsoft.PowerShell.Host.ISE.ISEOptions<br \/>FontSize&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 12<br \/>FontName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Lucida Console<br \/>ErrorForegroundColor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : #FFFF0000<br \/>ErrorBackgroundColor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : #00FFFFFF<br \/>WarningForegroundColor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : #FFFF8C00<br \/>WarningBackgroundColor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : #00FFFFFF<br \/>VerboseForegroundColor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : #FF0000FF<br \/>VerboseBackgroundColor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : #00FFFFFF<br \/>DebugForegroundColor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : #FF0000FF<br \/>DebugBackgroundColor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : #00FFFFFF<br \/>OutputPaneBackgroundColor&nbsp;&nbsp;&nbsp;&nbsp; : #FFF0F8FF<br \/>OutputPaneTextBackgroundColor : #FFF0F8FF<br \/>OutputPaneForegroundColor&nbsp;&nbsp;&nbsp;&nbsp; : #FF000000<br \/>CommandPaneBackgroundColor&nbsp;&nbsp;&nbsp; : #FFFFFFFF<br \/>ScriptPaneBackgroundColor&nbsp;&nbsp;&nbsp;&nbsp; : #FFFFFFFF<br \/>ScriptPaneForegroundColor&nbsp;&nbsp;&nbsp;&nbsp; : #FF000000<br \/>ShowWarningForDuplicateFiles&nbsp; : True<br \/>ShowWarningBeforeSavingOnRun&nbsp; : True<br \/>UseLocalHelp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : True<br \/>CommandPaneUp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : False <\/font> <\/p>\n<p>On one of my laptops, the screen resolution is 1900&#215;1200 so 12 points is pretty hard to read. But it is easy to change with this command:<\/p>\n<p><font face=\"Lucida Console\" color=\"#0000ff\" size=\"1\">$psise.options.fontsize=20<\/font><\/p>\n<p>The font size is changed immediately in all panels. It also applies to any new tabs I might open and is persistent. When I restart the ISE, the font size remains the same. Of course you can also simply rescale using the text slider in the lower right corner, but where&#8217;s the challenge in that!<\/p>\n<p>Of course you can also change the font itself. This is a lot of fun. Try these commands to see for yourself.<\/p>\n<p><font face=\"Lucida Console\" color=\"#0000ff\" size=\"1\">$psise.options.fontname=&#8221;tahoma&#8221;<\/font><\/p>\n<p><font face=\"Lucida Console\" color=\"#0000ff\" size=\"1\">$psise.options.fontname=&#8221;courier new&#8221;<\/font><\/p>\n<p><font face=\"Lucida Console\" color=\"#0000ff\" size=\"1\">$psise.options.fontname=&#8221;segoe print&#8221;<\/font><\/p>\n<p><font face=\"Lucida Console\" color=\"#0000ff\" size=\"1\">$psise.options.fontname=&#8221;comic sans ms&#8221; <\/font> <\/p>\n<p><font size=\"2\"><font face=\"Lucida Console\"><font color=\"#0000ff\"><font size=\"1\">$psise.options.fontname=&#8221;chiller&#8221;<\/font> <\/font><\/font><\/font><\/p>\n<p>These changes also affect all panels and all tabs. You may also need to adjust font sizes for some of these fonts. Not every font will work. Unlike font size, these changes are not persistent so if you would like a different font every time, add the appropriate code to your ISE profile. <\/p>\n<p>This is a different profile than what you use with the regular PowerShell&nbsp; console.&nbsp; In the ISE type $profile to see the name of your profile. You may have to create it.<\/p>\n<p><font face=\"Lucida Console\" color=\"#0000ff\" size=\"1\">if (!(test-path $profile )) <br \/>{new-item -type file -path $profile -force}<\/font>  <\/p>\n<p>Open the file in PrimalScript and edit.&nbsp; The ISE offers a wealth of opportunities so I&#8217;ll be back with more goodies from time to time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A popular PowerShell version 2 feature is the graphical PowerShell console, known as the Integrated Script Environment or ISE. The ISE has its own object model which means you can customize it. Here a few things you might want to tweak, or at least experiment with.<\/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":[25],"tags":[147,449,28],"class_list":["post-1352","post","type-post","status-publish","format-standard","hentry","category-windows-powershell","tag-ctp","tag-ise","tag-powershell"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/1352","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=1352"}],"version-history":[{"count":0,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/1352\/revisions"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=1352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=1352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=1352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}