<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Hey, Scripting Guy! Weekend Scripter: Using Windows PowerShell 2.0 to Display Color-Coded Output in a Table</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2010/06/05/hey-scripting-guy-weekend-scripter-using-windows-powershell-2-0-to-display-color-coded-output-in-a-table.aspx</link><description>Microsoft Scripting Guy Ed Wilson here. Summer has finally hit Charlotte, North Carolina, in full force. It is 87 degrees outside, and the humidity is 78 percent. This makes for a very hot and sticky day. I do not enjoy being hot and sticky, and therefore</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Hey, Scripting Guy! Weekend Scripter: Using Windows PowerShell 2.0 to Display Color-Coded Output in a Table</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2010/06/05/hey-scripting-guy-weekend-scripter-using-windows-powershell-2-0-to-display-color-coded-output-in-a-table.aspx#3386558</link><pubDate>Thu, 10 Feb 2011 17:31:29 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3386558</guid><dc:creator>Scott R.</dc:creator><description>&lt;p&gt;Thanks for the article and example.&lt;/p&gt;
&lt;p&gt;I tried your example code as-is and it works as described. &amp;nbsp;I then tried to apply that example to a specific use, and the result is the whole set of Format-Table output as all one color (and not necessarily the default foreground color).&lt;/p&gt;
&lt;p&gt;After much experimenting, I found that the behavior difference was related to my use of the -AutoSize parameter on the Format-Table cmdlet, where your example did not use -AutoSize. &amp;nbsp;When I add -AutoSize to your example, it no longer displays the colors as before.&lt;/p&gt;
&lt;p&gt;My best understanding of the resulting behavior is that it appears when -AutoSize is used with the selective color code approach, the entire Format-Table output will take on the color of the last line of output.&lt;/p&gt;
&lt;p&gt;Any suggestions on how to get selective colors approach and -AutoSize to cooperatively work together?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Scott R.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3386558" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! Weekend Scripter: Using Windows PowerShell 2.0 to Display Color-Coded Output in a Table</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2010/06/05/hey-scripting-guy-weekend-scripter-using-windows-powershell-2-0-to-display-color-coded-output-in-a-table.aspx#3348842</link><pubDate>Fri, 06 Aug 2010 15:53:45 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3348842</guid><dc:creator>Dominic</dc:creator><description>&lt;p&gt;Thanks for this great post. Is there a way to make each column a different color? i.e. Process name could be grey, CPU could be Yellow, Memory could be red based on different thresholds?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3348842" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! Weekend Scripter: Using Windows PowerShell 2.0 to Display Color-Coded Output in a Table</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2010/06/05/hey-scripting-guy-weekend-scripter-using-windows-powershell-2-0-to-display-color-coded-output-in-a-table.aspx#3348834</link><pubDate>Fri, 06 Aug 2010 15:16:53 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3348834</guid><dc:creator>Dominic</dc:creator><description>&lt;p&gt;Is there a way to extend this color coding to just one column rather than the entire row? I tried adding the host.ui.rawui.foregroundcolor to each column but the last one in the row wins and the entire row becomes that color. The thought was you could have multiple alert items (CPU, Memory) and you could vary the color from green, yellow, red depending on threshold for that item whilst the Name column + header itself remains the default color.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3348834" width="1" height="1"&gt;</description></item></channel></rss>