PowerShell ISE v4
PowerShell ISE v4
PowerShell ISE v4
0
Created by http://powershellmagazine.com
KEYBOARD SHORTCUTS
General
Script Pane
Execution
CTRL+F4
CTRL+TAB
CTRL+SHIFT+TAB
CTRL+N
CTRL+O
Go to next script
Go to previous script
CTRL+T
CTRL+SHIFT+R
Ctrl+W
CTRL+TAB
CTRL+SHIFT+TAB
Start snippets
Toggle regions
CTRL+J
CTRL+M
Find in script
Find next in script
Find previous in script
Replace in script
CTRL+F
F3
SHIFT+F3
CTRL+H
Go to line
Go to match
CTRL+G
CTRL+]
F1
CTRL+F1
CTRL+ADD
CTRL+SUBTRACT
#CTRL+SPACE
#TAB
Start PowerShell.exe
CTRL+SHIFT+P
Console Pane
Go to Script Pane
Cycle through command history
Scroll to the output
CTRL+I
UP ARROW
DOWN ARROW
CTRL+UP ARROW
CTRL+SHIFT+U
CTRL+U
ALT+SHIFT+T
CTRL+SPACE
CTRL+D
CTRL+R
CTRL+1
CTRL+2
CTRL+3
Run a script
Run only selection
Run current caret line
Stop execution
F5
F8
F8
CTRL+BREAK
CTRL+C
F9
F5
F11
F10
SHIFT+F11
CTRL+SHIFT+D
CTRL+SHIFT+L
CTRL+SHIFT+F9
SHIFT+F5
C
S
V
O
Enter
K
Q
L
H or ?
PowerShell_ISE.exe PARAMETERS
PowerShell_ISE.exe
-File "file1.ps1, file2.ps1" [Opens file1 & file2]
-NoProfile [Does not run profile script]
-MTA [Starts ISE in MTA mode]
ISE SNIPPETS
Snippets are an easy way to insert chunks of reusable or template code into a script. The snippet
functions are available only in ISE.
Create a new Snippet
$textcode = 'workflow MyWorkflow{
}'
New-IseSnippet -Title "Workflow" -Text $textcode `
-Description "New workflow block"
Get ISE Snippets
Get-IseSnippet
$psISE.Options
Defines the ISE color scheme and appearance-related
options. For example, use these options to set how ISE
color scheme looks, how the ISE panes appear, font size,
font name, and IntelliSense options.
The color scheme and appearance options are best
adjusted by using commands on the Tools -> Options menu
item in ISE. Here is the other important information:
To change "most recently used" count, set
$psISE.Options.MruCount to desired value between 0,32.
To disable local help, set $psISE.Options.UseLocalHelp to
$false.
$psISE.Options.RestoreDefaults() restores all options to
ISE defaults.
$psISE.Options
$psISE.CurrentFile
$psISE.PowerShellTabs
$psISE.CurrentPowerShellTab
$psISE. CurrentVisibleHorizontalTool
$psISE. CurrentVisibleVerticalTool
The $psISE.CurrentVisibleHorizontalTool and
$psISE.CurrentVisibleVerticalTool objects are
available only when an add-on--for example, the
ShowCommands add-on--is visible in ISE.
$psISE.CurrentFile
Defines the properties of the current open file in ISE Script
Pane such as displayname, fullpath, encoding, etc.
$psISE
$psISE.CurrentPowerShellTab
$addon = $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus
$addon.Remove($addon[0])
$psISE.PowerShellTabs
Defines a collection of open PowerShell tabs in ISE. Each
instance of PowerShell tab contains the same properties
and methods as $psISE.CurrentPowerShellTab.
$psISE.PowerShellTabs.Files lists all open files in ISE
across all open PowerShell tabs.
$psISE.PowerShellTabs.AddonsMenu lists all add-on
menus available across all open PowerShell tabs.
$psISE events
The $psISE scripting object model provides events when a property or collection changes within ISE. These events are
usually named as PropertyChanged or CollectionChanged based on the object.
For example, the following code adds an add-on menu to all newly opened PowerShell tabs:
Register-ObjectEvent -InputObject $psise.PowerShellTabs -EventName CollectionChanged -Action {
if ($event.SourceEventArgs.Action -eq "Add") {
$event.Sender[1].AddOnsMenu.SubMenus.Add("Select _Line",{$psISE.CurrentFile.Editor.SelectCaretLine()},"Alt+L") } }