I had a few people asking me how I managed to format the source code for my PowerShell posts, so here’s a short explanation. Just type (or paste) your post and when it’s time to insert the source code, switch to HTML view.

There you can insert these tags:

[sourcecode language="csharp"]

And it will come out like this:

  return "Yay!";

Yes, that’s all there is to it.

There are actually quite a few languages that are supported. You can see the full list and an explanation on some extra parameters on this official WordPress page: http://en.support.wordpress.com/code/posting-source-code/