There are lot of ways to add syntax highlighting to the PowerShell code in your blog, see the post by MVP Francios Xavier-Cat.
I just happened to come across one more which is pretty easy to use and best part is it uses a PowerShell module to do so.
The module has a single cmdlet called "Copy-ColorizedHTML" which copies the HTML content in your clipboard for use.
Once the content is copied to your clipboard just paste it to your blog.
NOTE - This method can also be used to while authoring an article for Technet Wiki.
see the animated GIF below:
Enjoy !
I just happened to come across one more which is pretty easy to use and best part is it uses a PowerShell module to do so.
Follow the below steps :
- Download the Copy to Colorized HTML module and put the extracted copy in your Modules directory.
- Add the below code to your ISE Profile, which will add a submenu and the "Ctrl+Shift+C" shortcut to copy the HTML content in your clipboard.
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add(“Copy As Colorized HTML”,{Copy-ColorizedHTML},“Ctrl+Shift+C”) | Out-Null
|
The module has a single cmdlet called "Copy-ColorizedHTML" which copies the HTML content in your clipboard for use.
Once the content is copied to your clipboard just paste it to your blog.
NOTE - This method can also be used to while authoring an article for Technet Wiki.
see the animated GIF below:
Enjoy !