pre tags and inserts it at the position of the cursor.
UPDATE: You could use combination of the
var currentContent=new Array;
'dialogHeight: 550px; dialogWidth:500px; help: no; status:no; resizable: yes');
if (returnValue != "")
returnValue = "<pre class=\"language-powershell\">" + returnValue + "</pre>";
All you have to do now is create your custom action and you should be all set.
For SharePoint 2007 you need to hack into the rich-text editor (note: works only in IE) function
RTE_FullHtmlToolBarDefinitionFactory to add a button to the toolbar which then does the same as above.
I've been doing that some time ago for a SharePoint 2007 Blog and Wiki using the Google Code Prettifier project and it worked so far (with some issues in old IE 6/7 browsers, though).