Based on Lee Holmes Set-ClipboardScript located here: ""

This script editor add-on will copy the current window to HTML ready to post on a blog or web page.
This tool is found under Edit -> Copy As -> Colorized HTML

The script will copy the entire document window if no text is selected. If text within the current document window is selected, just that text will get copied to the clipboard.

This is different from the built in function in that the clipboard can be pasted directly into an HTML compliant program like Microsoft Outlook as HTML without first saving as an HTML file. The pasted data also includes line numbers in a separate column.

To install the add-on, follow these steps:
1) Download the file from the Downloads box at the right of this page, and extract it into your module folder. (C:\users\\Documents\WindowsPowerShell\Modules)
2) In the File / PowerShell Libraries dialog box, select Add-on.CopyAsColorizedHTML.

To use the data in Windows Live Writer, you need to right click in the Live Writer window, select Paste Special, and Keep Formatting.