Geeks With Blogs

News

qrcode

Lance Robinson

Create Your Badge

Lance Robinson is a software engineer in Durham, Chapel Hill, Raleigh, and surrounding areas. More about Lance.

 Subscribe


Lance's TextBox » About Me » My Resume »Twitter

Adrian at soapyfrog posted a function recently for grabbing the contents of the PowerShell console buffer and pushing them out as html. I saved it and finally got around to using it today. Very useful, added to my profile. Thanks Adrian!

 


PS C:\> (get-nntp -server msnews.microsoft.com -newsgroup microsoft.public.windows.powershell -list 5) | sort From      
                                                                                                                        
                                                                                                                        
Number       : 7804                                                                                                     
Subject      : Re: More.com?? Quirk                                                                                     
From         : "/\\/\\o\\/\\/ [MVP]"                                                          
Date         : Tue, 23 Jan 2007 19:53:16 +0100                                                                          
Size         : 2610                                                                                                     
References   : <9eo6r256msnc3cvm527hm6202kiv9dkq1l@4ax.com> <ur6Gy2rPHHA.1280@TK2MSFTNGP04.phx.gbl> <eLQ04sxPHHA.4172@T 
               K2MSFTNGP03.phx.gbl>                                                                                     
MessageID    : <529B5064-584A-4B5E-A14C-831F2638B7A8@microsoft.com>                                                     
Otherheaders : Xref: TK2MSFTNGP01.phx.gbl microsoft.public.windows.powershell:7804                                      
                                                                                                                        
Number       : 7802                                                                                                     
Subject      : Re: More.com?? Quirk                                                                                     
From         : "Keith Hill [MVP]"                                           
Date         : Tue, 23 Jan 2007 11:20:53 -0700                                                                          
Size         : 1157                                                                                                     
References   : <9eo6r256msnc3cvm527hm6202kiv9dkq1l@4ax.com> <ur6Gy2rPHHA.1280@TK2MSFTNGP04.phx.gbl>                     
MessageID    : <eLQ04sxPHHA.4172@TK2MSFTNGP03.phx.gbl>                                                                  
Otherheaders : Xref: TK2MSFTNGP01.phx.gbl microsoft.public.windows.powershell:7802                                      
                                                                                                                        
Number       : 7800                                                                                                     
Subject      : Re: Executing from \\127.0.0.1\C$ doesn&apos;t work                                                           
From         : "Keith Hill [MVP]"                                           
Date         : Tue, 23 Jan 2007 10:24:44 -0700                                                                          
Size         : 3874                                                                                                     
References   : <#FvgnfnPHHA.320@TK2MSFTNGP06.phx.gbl>   <1169507373.493197.256260@a75g2000cwd.googlegroups.com>   <O8#c 
               9eoPHHA.1252@TK2MSFTNGP02.phx.gbl> <1169566384.862507.111920@a34g2000cwb.googlegroups.com>               
MessageID    : <#Fq$gNxPHHA.4376@TK2MSFTNGP02.phx.gbl>                                                                  
Otherheaders : Xref: TK2MSFTNGP01.phx.gbl microsoft.public.windows.powershell:7800                                      
                                                                                                                        
Number       : 7801                                                                                                     
Subject      : Re: Set alias with parameter                                                                             
From         : "Keith Hill [MVP]"                                            
Date         : Tue, 23 Jan 2007 11:18:49 -0700                                                                          
Size         : 2017                                                                                                     
References   : <j2uj93ykcp7d.jgcs1ej55she.dlg@40tude.net> <7fbcr2h9d6n3rv85tpl151b5qbvacc3cit@4ax.com>                  
MessageID    : <OrVavrxPHHA.1552@TK2MSFTNGP05.phx.gbl>                                                                  
Otherheaders : Xref: TK2MSFTNGP01.phx.gbl microsoft.public.windows.powershell:7801                                      
                                                                                                                        
Number       : 7803                                                                                                     
Subject      : Re: Set alias with parameter                                                                             
From         : Jeffery Hicks                                                                  
Date         : Tue, 23 Jan 2007 13:54:27 -0500                                                                          
Size         : 2589                                                                                                     
References   : <j2uj93ykcp7d.jgcs1ej55she.dlg@40tude.net> <7fbcr2h9d6n3rv85tpl151b5qbvacc3cit@4ax.com> <OrVavrxPHHA.155 
               2@TK2MSFTNGP05.phx.gbl>                                                                                  
MessageID    : <h3r6xdni0857$.mkvtwmftypyk.dlg@40tude.net>                                                              
Otherheaders : Xref: TK2MSFTNGP01.phx.gbl microsoft.public.windows.powershell:7803                                      
                                                                                                                        
                                                                                                                        
                                                                                                                        
PS C:\> get-bufferhtml | out-file sample.html                                                                           

Posted on Tuesday, January 23, 2007 2:19 PM PowerShell | Back to top


Comments on this post: PowerShell console buffer to html

# re: PowerShell console buffer to html
Requesting Gravatar...
Where did you get a get-nntp cmdlet?
Left by Marco Shaw on Jan 23, 2007 2:32 PM

# re: PowerShell console buffer to html
Requesting Gravatar...
Assuming this will be part of netcmdlets, will one be able to access the body/text of the messages?

Sure would be nice to have a full NNTP cmdlet... I've been using a free library from www.smilla.ru previously.
Left by Marco Shaw on Jan 23, 2007 2:35 PM

# re: PowerShell console buffer to html
Requesting Gravatar...
Hi Lance, glad you found the script useful. You may be interested to know that I updated it today. Updated version at http://ps1.soapyfrog.com/2007/01/06/console-screen-grabs-in-html/
Left by Adrian Milliner on Jan 25, 2007 8:58 AM

Your comment:
 (will show your gravatar)


Copyright © Lance Robinson | Powered by: GeeksWithBlogs.net