I ran into this problem yesterday when trying to email some Powershell code to a coworker in that all of the code highlighting and indenting was messed up when pasting in to Outlook. Is there a site that will take Powershell (C#, HTML, etc) and provide some nicely formatted/highlighted output that can be cut and paste into an email or application that supports HTML rendering?

Even better if it also supported other formatting tags for forums and the like.

link|improve this question

feedback

2 Answers

up vote 7 down vote accepted

There's a website just for this: To-Html

Ta-da! Here's a site with Powershell!

link|improve this answer
It has Z80 assembly but no Powershell. – dlux Sep 3 '09 at 20:22
Humbug. I just kind of figured Powershell was in that big list of languages. I'll have to try to find something else. – Dan Walker Sep 3 '09 at 20:27
tohtml is the one site I've found where I could copy/paste the resulting text into a word doc or email and have the coloring (including background) remain intact. I use it a lot when writing up code reviews and need to provide code snippets. – Herms Sep 3 '09 at 20:43
I'll toss you a +1 for finding the Powershell site, but unfortunately it does not display the HTML in a way that can be cut and paste with formatting. To-HTML does, but doesn't support Powershell. – dlux Sep 3 '09 at 21:28
Nevermind...I forgot to turn off "Keep text only" when pasting. :) – dlux Sep 3 '09 at 21:31
feedback

This article compares six such sites : Online Syntax Highlighters on the web.
Read also the comments for a seventh very good highlighter.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.