Sample usage, Powershell ISE add-in
Add the snippet below to your ISE profile. The profile for the current user is defined in
$env:UserProfile\My Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1
. C:\pshtmlhighlight\Highlight-Syntax.ps1
Import-Module C:\psmodules\Pscx
$addonsmenu = $psISE.CurrentPowerShellTab.AddOnsMenu
$addonsmenu.Submenus.Clear()
$addonsmenu.Submenus.Add("Copy as html", { $psISE.CurrentFile.Editor.SelectedText | Convert-PS2Html | Out-clipboard }, "Ctrl+Alt+C") | Out-Null