You are on page 1of 2

PowerShell Integrated Scripting Environment 3.

0
Created by http://powershellmagazine.com

Keyboard Shortcuts Script Pane Console Pane

Close an open script CTRL+F4 Go to Script Pane CTRL+I


General Cycle through command history UP ARROW
Go to next script CTRL+TAB DOWN ARROW
Create new script CTRL+N Scroll to the output CTRL+UP ARROW
Open a script CTRL+O Go to previous script CTRL+SHIFT+TAB

NOTE: The shortcuts for switching between tabs is Execution


New PowerShell tab CTRL+T
Open a remote tab CTRL+SHIFT+R contextual. To switch between tabs using the above
sequence, Script Pane must be in focus. Run a script F5
Close an open tab Ctrl+W Run only selection F8
Start snippets CTRL+J Run current caret line F8
Go to next PowerShell tab CTRL+TAB Stop execution CTRL+BREAK
Go to previous PowerShell tab CTRL+SHIFT+TAB Toggle regions CTRL+M
CTRL+C
NOTE: To switch between tabs using the above Find in script CTRL+F
Find next in script F3 NOTE: Using CTRL+C for script execution termination works
sequence, Console Pane must be in focus. only when no text selected in the Script or Console Pane.
Find previous in script SHIFT+F3
PowerShell ISE help F1 Replace in script CTRL+H
Show Command CTRL+F1
Go to line CTRL+G Debugging (Script Pane)
NOTE: Remember that both commands require you Go to match CTRL+]
Toggle breakpoint F9
to select the command in the editor or console pane Continue F5
or at least place the cursor near the command before NOTE: "Go to match" edit menu option will be
available only when the cursor is pointed at script block Step into F11
invoking the key sequence. Step over F10
beginning/end. In other words, it must be placed at the
opening or closing brace. Step out SHIFT+F11
Zoom in CTRL+ADD Display call stack CTRL+SHIFT+D
Zoom out CTRL+SUBTRACT List breakpoints CTRL+SHIFT+L
To upper case CTRL+SHIFT+U
To lower case CTRL+U Remove all breakpoints CTRL+SHIFT+F9
Invoke command history #CTRL+SPACE Stop debugger SHIFT+F5
Cycle through history #TAB Transpose lines ALT+SHIFT+T
Start IntelliSense CTRL+SPACE
Go to Console Pane CTRL+D Debugging (Console Pane)
Start PowerShell.exe CTRL+SHIFT+P
Show / Hide Script Pane CTRL+R
Continue C
Show Script Pane top CTRL+1 Step into S
Show Script Pane right CTRL+2 Step over V
PowerShell_ISE.exe Parameters Show Script Pane maximized CTRL+3 Step out O
Repeat last command Enter
PowerShell_ISE.exe NOTE: Make a note that only a subset of above Script Display call stack K
-File "file1.ps1, file2.ps1" [Opens file1 & file2] Pane keyboard shortcuts will be available based on the Stop debugger Q
-NoProfile [Does not run profile script] current Script Pane state. List the script L
-MTA [Starts ISE in MTA mode] Display console debug commands H or ?
PowerShell Integrated Scripting Environment 3.0
Created by http://powershellmagazine.com

ISE Snippets $psISE.Options $psISE.CurrentPowerShellTab


Defines the ISE color scheme and appearance-related Defines the properties of the current PowerShell tab and a
Snippets are an easy way to insert chunks of re- options. For example, use these options to set how ISE collection of files in the tab. Also, defines the method to
usable or template code into a script. The snippet color scheme looks, how the ISE panes appear, font size, extend ISE add-on menu.
functions are available only in ISE. font name, and IntelliSense options.
Create a new Snippet $psISE.CurrentPowerShellTab.Files defines a collection of
$textcode = 'workflow MyWorkflow{ The color scheme and appearance options are better open files in the tab that can be managed the same way as
adjusted using the Tools -> Options menu item in ISE using $psISE.CurrentFile.
}' the visual tools. Here is other important information:
New-IseSnippet -Title "Workflow" -Text $textcode ` $psISE.CurrentPowerShellTab.AddonsMenu contains a
-Description "New workflow block" To change "most recently used" count, set collection of existing add-on menus and method to create
$psISE.Options.MruCount to desired value between 0,32. new.
Get ISE Snippets
Get-IseSnippet To disable local help, set $psISE.Options.UseLocalHelp to To add a new add-on menu
$false. $script = { $psISE.CurrentFile.Editor.SelectCaretLine() }
ISE Object Model $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Ad
$psISE.Options.RestoreDefaults() restores all options to d("Select _Line",$script,"Alt+L")
Windows PowerShell Integrated Scripting ISE defaults.
Environment (ISE) exposes its underlying scripting To remove an add-on menu at index 0
object model to allow manipulation of various visual $psISE.CurrentFile $addon = $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus
and functional aspects of ISE. $psISE is the root object $addon.Remove($addon[0])
of the ISE object hierarchy. Defines the properties of the current open file in ISE Script
Pane such as displayname, fullpath, encoding, etc. $psISE.PowerShellTabs
$psISE
$psISE.CurrentFile.Editor contains the information about Defines a collection of open PowerShell tabs in ISE. Each
$psISE.Options the script editor and the contents of the editor. instance of PowerShell tab contains the same properties
and methods as $psISE.CurrentPowerShellTab.
$psISE.CurrentFile $psISE.CurrentFile.Editor.InsertText("sample") inserts
specified text at the current caret position. $psISE.PowerShellTabs.Files lists all open files in ISE
across all open PowerShell tabs.
$psISE.PowerShellTabs
$psISE.CurrentFile.Editor.Clear() clears the text in the
editor. $psISE.PowerShellTabs.AddonsMenu lists all add-on
$psISE.CurrentPowerShellTab menus available across all open PowerShell tabs.
$psISE.CurrentFile.Editor.SelectCaretLine() selects the line
$psISE. CurrentVisibleHorizontalTool where cursor is placed. $psISE events

The $psISE scripting object model provides events when a property or collection changes within ISE. These events are
$psISE. CurrentVisibleVerticalTool
usually named as PropertyChanged or CollectionChanged based on the object.
The $psISE.CurrentVisibleHorizontalTool and
$psISE.CurrentVisibleVerticalTool objects are For example, the following code adds an add-on menu to all newly opened PowerShell tabs:
available only when an add-on--for example, the Register-ObjectEvent -InputObject $psise.PowerShellTabs -EventName CollectionChanged -Action {
ShowCommands add-on--is visible in ISE. if ($event.SourceEventArgs.Action -eq "Add") {
$event.Sender[1].AddOnsMenu.SubMenus.Add("Select _Line",{$psISE.CurrentFile.Editor.SelectCaretLine()},"Alt+L") } }

You might also like