<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.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>Search results matching tags 'PowerShell', 'Performance Tuning', and 'Tips'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=PowerShell,Performance+Tuning,Tips&amp;orTags=0</link><description>Search results matching tags 'PowerShell', 'Performance Tuning', and 'Tips'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>PowerShell Version Two – Get Continuous Perf Counters</title><link>http://sqlblog.com/blogs/buck_woody/archive/2010/02/25/powershell-version-two-get-continuous-perf-counters.aspx</link><pubDate>Thu, 25 Feb 2010 14:32:52 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:22620</guid><dc:creator>BuckWoody</dc:creator><description>&lt;p&gt;In version 2.0 of PowerShell, you can now use a direct command-let (get-Counter) to get at the Performance Monitor counters. For instance, to show the current value of the Processor Percent Time, use this command:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;span style="color:blue;"&gt;Get-Counter&lt;/span&gt; &lt;span style="color:darkred;"&gt;'\Processor(*)\% Processor Time'&lt;/span&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;The interesting part of get-Counter is that you can add a parameter at the end to keep sampling:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;span style="color:blue;"&gt;Get-Counter&lt;/span&gt; &lt;span style="color:darkred;"&gt;'\Processor(*)\% Processor Time' - Continuous&lt;/span&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Which is very useful if you’re doing performance troubleshooting like I am this morning. And yes, you can use this to get at SQL Server counters as well – to see the entire set of counters, use this command:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;span style="color:blue;"&gt;Get-Counter&lt;/span&gt; &lt;span style="color:navy;"&gt;–listSet&lt;/span&gt; &lt;span style="color:blueviolet;"&gt;*&lt;/span&gt; &lt;span style="color:darkgray;"&gt;|&lt;/span&gt; &lt;span style="color:blue;"&gt;Select-Object&lt;/span&gt; &lt;span style="color:navy;"&gt;-ExpandProperty&lt;/span&gt; &lt;span style="color:blueviolet;"&gt;Paths&lt;/span&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;p style="margin:0in 0in 0pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;b&gt;&lt;i style="mso-bidi-font-style:normal;"&gt;&lt;span style="color:maroon;font-size:10pt;mso-bidi-font-size:11.0pt;mso-bidi-font-family:calibri;mso-ansi-language:en;"&gt;Script Disclaimer, for people who need to be told this sort of thing: &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&lt;i style="mso-bidi-font-style:normal;"&gt;&lt;span style="color:maroon;font-size:10pt;mso-bidi-font-family:calibri;mso-ansi-language:en;"&gt;           &lt;p&gt;&lt;/p&gt;         &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin:0in 0in 0pt;" class="MsoNormal"&gt;&lt;i style="mso-bidi-font-style:normal;"&gt;&lt;span style="color:maroon;font-size:10pt;mso-bidi-font-family:calibri;mso-ansi-language:en;"&gt;&lt;font face="Calibri"&gt;Never trust any script, including those that you find here, until you understand exactly what it does and how it will act on your systems. Always check the script on a test system or Virtual Machine, not a production system. All scripts on this site are performed by a professional stunt driver on a closed course. Your mileage may vary. Void where prohibited. Offer good for a limited time only. Keep out of reach of small children. Do not operate heavy machinery while using this script. If you experience blurry vision, indigestion or diarrhea during the operation of this script, see a physician immediately.&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;</description></item></channel></rss>