Skip to content
Menu
The Lonely Administrator
  • PowerShell Tips & Tricks
  • Books & Training
  • Essential PowerShell Learning Resources
  • Privacy Policy
  • About Me
The Lonely Administrator

A few ISE tweaks

Posted on March 8, 2011March 7, 2011

If you use the PowerShell ISE as your primary script editor, you might want to tweak it a bit. The first thing you'll need is your ISE profile script. If it doesn't exist, you'll need to create. PowerShell will look for file C:\Users\USERNAME\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1 (on Windows 7 anyway). Any commands you put in this file will be applied to your ISE session.

Manage and Report Active Directory, Exchange and Microsoft 365 with
ManageEngine ADManager Plus - Download Free Trial

Exclusive offer on ADManager Plus for US and UK regions. Claim now!

This is where you can take advantage of the ISE object model. I like to configure my font.

[cc lang="PowerShell"]
#configure the console
$psise.options.fontsize=16
$psise.options.fontname="Consolas"
[/cc]

You can also add items to the menu like my Most Recent Files. One other menu choice I've added recently is Open Script Folder. This line of code will open the folder of the current script in Windows Explorer. Handy when you want to do something with the file itself or other files you know are in the same folder. To add his feature, include this line in your ISE profile.

[cc lang="PowerShell"]
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add("Open Current Script Folder",{Invoke-Item (split-path $psise.CurrentFile.fullpath)},"ALT+O") | out-Null
[/cc]

I pipe to Out-Null purely for cosmetic reasons so I don't see the command in the results pane when I start the ISE. My menu choices uses the ALT+O shortcut. You can change it if you want. The next time you start the ISE you should get these options.

Enjoy.


Behind the PowerShell Pipeline

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to print (Opens in new window) Print
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

1 thought on “A few ISE tweaks”

  1. Chad Miller says:
    March 8, 2011 at 12:09 pm

    Here’s one I noticed in some of the demos at TechEd 2010, change the OutputPane to look more console-like:

    $psISE.Options.OutputPaneBackgroundColor = ‘#FF000000’
    $psISE.Options.OutputPaneTextBackgroundColor = ‘#FF000000’
    $psISE.Options.OutputPaneForegroundColor = ‘#FFFFFFFF’

Comments are closed.

reports

Powered by Buttondown.

Join me on Mastodon

The PowerShell Practice Primer
Learn PowerShell in a Month of Lunches Fourth edition


Get More PowerShell Books

Other Online Content

github



PluralSightAuthor

Active Directory ADSI Automation Backup Books CIM CLI conferences console Friday Fun FridayFun Function functions Get-WMIObject GitHub hashtable HTML Hyper-V Iron Scripter ISE Measure-Object module modules MrRoboto new-object objects Out-Gridview Pipeline PowerShell PowerShell ISE Profile prompt Registry Regular Expressions remoting SAPIEN ScriptBlock Scripting Techmentor Training VBScript WMI WPF Write-Host xml

©2025 The Lonely Administrator | Powered by SuperbThemes!
%d