header image

Code in Posts

Posted by: | June 6, 2010 | No Comment |

I’ve been asked a couple of times recently how I put the colour highlighted code into the posts on my blog(s).

I create the posts using Live Writer. The scripts are usually developed in PowerShell ISE.  I have a script I modified from

http://www.leeholmes.com/blog/MorePowerShellSyntaxHighlighting.aspx that creates an add-on to copy the script from ISE to the clipboard.

I then chose Edit-Paste Special from the Live Writer menu and select Keep Formatting.

Only issue is ensuring that the lines of code aren’t too long for  the display width on the blog.

under: PowerShellV2