Last active
August 23, 2016 02:00
-
-
Save mattmcnabb/fa25dedb8ed23a3b8b79c0c23c480fde to your computer and use it in GitHub Desktop.
Blog_ISESteroids-make-it-yours
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$SB = { | |
$Command = Get-Command -Name $args[1] | |
Get-Module -Name $Command.ModuleName | | |
Format-List Name, Description, Version, PowerShellHostName, | |
PowerShellVersion, Author, CompanyName | |
} | |
Add-SteroidsContextMenuCommand -DisplayName 'Get Parent Module' -TokenType Command -ScriptBlock $SB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-SteroidsTool -DisplayName 'WMI Tester' -Path wbemtest.exe -ToolTip 'Explore WMI classes and compose queries' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this line will add a new custom command with the keyboard shortcut ALT+T: | |
$psise.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Start Regedit', { regedit.exe }, 'ALT+T') | |
# this line will add a new custom command without a keyboard shortcut: | |
$psise.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Get Script Path', { $psise.CurrentFile.FullPath }, $null) | |
# these lines will first add a submenu, then add commands to it: | |
$parent = $psise.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add('My Tools', $null, $null) | |
$parent.Submenus.Add('Close All Editors', { $psise.CurrentPowerShellTab.Files.Clear() }, 'ALT+X' ) | |
$parent.Submenus.Add('Open powertheshell.com', { Start-Process www.powertheshell.com }, 'ALT+P' ) | |
# all commands will be defined once you run this script | |
# to define commands permanently, place this code into your profile script | |
# the path to the profile script can be found in $profile. You may have to create the file and subfolder first. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$null = $psise.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Remove Trailing Blanks', {Remove-TrailingBlanks},$null) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment