Created
July 1, 2016 14:41
-
-
Save jdhitsolutions/75a7216ab86110f7a2c1507d3b29499c to your computer and use it in GitHub Desktop.
Add a menu shortcut in the PowerShell ISE to insert a dated ToDo comment
This file contains hidden or 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
#Insert a ToDo comment in an ISE script file | |
$action = { | |
$psise.CurrentFile.Editor.InsertText("# [$((Get-Date).ToShortDateString())] ToDo: ") | |
#jump cursor to the end | |
$psise.CurrentFile.editor.SetCaretPosition($psise.CurrentFile.Editor.CaretLine,$psise.CurrentFile.Editor.CaretColumn) | |
} | |
#add the action to the Add-Ons menu | |
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add("ToDo",$Action,"Alt+2" ) | Out-Null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is now part of the PSScriptTools module https://github.com/jdhitsolutions/PSScriptTools