Skip to content

Instantly share code, notes, and snippets.

@jdhitsolutions
Created July 1, 2016 14:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdhitsolutions/75a7216ab86110f7a2c1507d3b29499c to your computer and use it in GitHub Desktop.
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
#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
@jdhitsolutions
Copy link
Author

This is now part of the PSScriptTools module https://github.com/jdhitsolutions/PSScriptTools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment