"William Stacey [C# MVP]" <william.stacey@gmail.com> wrote in message
news:#FFNkYweHHA.4032@TK2MSFTNGP02.phx.gbl...
> Bit OT, but psh related. So this guy has a get-html script that grabs the
> console as formatted html. So how do I paste this output in OneNote or
> Word
> so it shows up rendered and not just text? I have been scratching my head
> for some time. tia
>
> http://ps1.soapyfrog.com/2007/01/06/...grabs-in-html/
>
With PSCX 1.1.1 you can do this:
gps | ConvertTo-Html Name, Id, Handles | Join-String | Set-Clipboard -Html
{$_}
Without PSCX 1.1.1, it gets tricky because you have to call the
System.Windows.Forms.Clipboard.SetText($text, 'Html') method on a separate
thread that is configured STA.
--
Keith