{"id":1874,"date":"2011-12-06T11:47:01","date_gmt":"2011-12-06T16:47:01","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1874"},"modified":"2011-12-06T11:47:01","modified_gmt":"2011-12-06T16:47:01","slug":"background-performance-counters","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/","title":{"rendered":"Background Performance Counters"},"content":{"rendered":"<p>Windows Powershell makes it relatively easy to collect performance counter information via the <a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkID=138335\" title=\"Read online help\" target=\"_blank\">Get-Counter<\/a> cmdlet. Because I'm assuming you want to collect more than a few seconds of performance information, you'll need to take advantage of PowerShell background jobs if you want your prompt back. Of course, you can always open a second session, but I like the background job approach. Here's how I've been experimenting with this.<!--more--><\/p>\n<p>For my test, I wanted to capture network interface information; specifically the counters bytes received\/sec, bytes sent\/sec and bytes totla\/sec. But I only wanted them for my primary interface. To discover the counter names, use the -ListSet parameter with Get-Counter.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nPS S:\\> get-counter -listset \"network*\"<br \/>\n[\/cc]<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listcounters.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listcounters-300x206.png\" alt=\"\" title=\"listcounters\" width=\"300\" height=\"206\" class=\"aligncenter size-medium wp-image-1876\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listcounters-300x206.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listcounters-1024x704.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listcounters.png 1164w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The standard counters would include all interfaces, but I would prefer to limit my query to a specific interface. But what are they?<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nPS S:\\> get-counter -list \"network interface\" | select -expand PathsWithInstances<br \/>\n[\/cc]<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listinterfaces.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listinterfaces-300x206.png\" alt=\"\" title=\"listinterfaces\" width=\"300\" height=\"206\" class=\"aligncenter size-medium wp-image-1877\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listinterfaces-300x206.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listinterfaces-1024x704.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listinterfaces.png 1164w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The interface I want has Atheros in the name, so let's filter.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nPS S:\\> get-counter -list \"network interface\" | select -expand PathsWithInstances | where {$_ -like \"*atheros*bytes*\"}<br \/>\n[\/cc]<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/atheroscounters.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/atheroscounters-300x88.png\" alt=\"\" title=\"atheroscounters\" width=\"300\" height=\"88\" class=\"aligncenter size-medium wp-image-1878\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/atheroscounters-300x88.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/atheroscounters-1024x301.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/atheroscounters.png 1172w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Now I know the counters I want. I'll do a quick test to verify.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nPS S:\\> $c=get-counter -list \"network interface\" | select -expand PathsWithInstances | where {$_ -like \"*atheros*bytes*\"}<br \/>\nPS S:\\> get-counter $c<br \/>\n[\/cc]<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/niccounters.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/niccounters-300x168.png\" alt=\"\" title=\"niccounters\" width=\"300\" height=\"168\" class=\"aligncenter size-medium wp-image-1879\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/niccounters-300x168.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/niccounters-1024x575.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/niccounters.png 1169w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>I'm not concerned about the 0 values. I know that when I start collecting there will be data. I'm also running this against the local machine. The better approach with performance monitoring is to gather data from a remote machine. But that is easy enough to do by using the -Computername parameter. For now, I'll keep testing locally. Of course, make sure you get the right instance from the remote machine.<\/p>\n<p>Now I can begin using Get-Counter. There are a number of parameters to control how long I gather data. I'm going to use -Continuous. I'll use Start-Job to kick off my data collection.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n$sb={<br \/>\n $c=get-counter -list \"network interface\" | select -expand PathsWithInstances | where {$_ -like \"*atheros*bytes*\"}<br \/>\n Get-counter -Counter $c -continuous<br \/>\n}<br \/>\nStart-Job $sb<br \/>\n[\/cc]<\/p>\n<p>When I'm finished collecting, I can use Stop-Job to terminate, then receive the job results.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nPS C:\\> stop-job 2<br \/>\nPS C:\\> $data=Receive-job 2 -keep<br \/>\n[\/cc]<\/p>\n<p>The $data variable contains all of the performance data. I might want to save it to a file if I plan on opening it later in the performance monitor management console.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nPS C:\\> $data | export-counter e:\\nicdata.csv -fileformat CSV<br \/>\n[\/cc]<\/p>\n<p>However, if you try that it will fail. Here's why. The results that come from the job are of the type Deserialized.Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSampleSet and Export-Counter doesn't know what to do with that. You could use Export-CSV, but I think the better approach is to include the export command as part of your job. Here's my revised scriptblock.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n$sb={<br \/>\n $c=get-counter -list \"network interface\" | select -expand PathsWithInstances | where {$_ -like \"*atheros*bytes*\"}<br \/>\n Get-counter -Counter $c -continuous | Export-Counter -FileFormat CSV -Path e:\\temp\\nic2.csv<br \/>\n}<br \/>\n[\/cc]<\/p>\n<p>Again, I can start the job and stop it when I'm done collecting. There really isn't any need to receive the results because everything I want is in the CSV file. I can import the CSV file into PowerShell using Import-CSV, load it in the Performance Counter management console, or open in Microsoft Excel and build a PivotTable report.<\/p>\n<p>If you'd like to learn more about gathering performance data or managing other aspects of your server infrastructure with PowerShell, take a look my my <a href=\"http:\/\/www.trainsignal.com\/Windows-Server-2008-PowerShell-Training.aspx\" title=\"Windows Server 2008 PowerShell Training\" target=\"_blank\">video training course<\/a> from TrainSignal.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows Powershell makes it relatively easy to collect performance counter information via the Get-Counter cmdlet. Because I&#8217;m assuming you want to collect more than a few seconds of performance information, you&#8217;ll need to take advantage of PowerShell background jobs if you want your prompt back. Of course, you can always open a second session, but&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[75,318,135],"tags":[340,202,341,534,333],"class_list":["post-1874","post","type-post","status-publish","format-standard","hentry","category-powershell-v2-0","category-train-signal","category-windows-server","tag-get-counter","tag-jobs","tag-perfmon","tag-powershell","tag-start-job"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Background Performance Counters &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Background Performance Counters &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Windows Powershell makes it relatively easy to collect performance counter information via the Get-Counter cmdlet. Because I&#039;m assuming you want to collect more than a few seconds of performance information, you&#039;ll need to take advantage of PowerShell background jobs if you want your prompt back. Of course, you can always open a second session, but...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-12-06T16:47:01+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listcounters-300x206.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell-v2-0\\\/1874\\\/background-performance-counters\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell-v2-0\\\/1874\\\/background-performance-counters\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Background Performance Counters\",\"datePublished\":\"2011-12-06T16:47:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell-v2-0\\\/1874\\\/background-performance-counters\\\/\"},\"wordCount\":618,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell-v2-0\\\/1874\\\/background-performance-counters\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/12\\\/listcounters-300x206.png\",\"keywords\":[\"Get-Counter\",\"Jobs\",\"PerfMon\",\"PowerShell\",\"Start-Job\"],\"articleSection\":[\"PowerShell v2.0\",\"Train Signal\",\"Windows Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell-v2-0\\\/1874\\\/background-performance-counters\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell-v2-0\\\/1874\\\/background-performance-counters\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell-v2-0\\\/1874\\\/background-performance-counters\\\/\",\"name\":\"Background Performance Counters &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell-v2-0\\\/1874\\\/background-performance-counters\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell-v2-0\\\/1874\\\/background-performance-counters\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/12\\\/listcounters-300x206.png\",\"datePublished\":\"2011-12-06T16:47:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell-v2-0\\\/1874\\\/background-performance-counters\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell-v2-0\\\/1874\\\/background-performance-counters\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell-v2-0\\\/1874\\\/background-performance-counters\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/12\\\/listcounters.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2011\\\/12\\\/listcounters.png\",\"width\":\"1164\",\"height\":\"801\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell-v2-0\\\/1874\\\/background-performance-counters\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell v2.0\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell-v2-0\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Background Performance Counters\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Background Performance Counters &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/","og_locale":"en_US","og_type":"article","og_title":"Background Performance Counters &#8226; The Lonely Administrator","og_description":"Windows Powershell makes it relatively easy to collect performance counter information via the Get-Counter cmdlet. Because I'm assuming you want to collect more than a few seconds of performance information, you'll need to take advantage of PowerShell background jobs if you want your prompt back. Of course, you can always open a second session, but...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-12-06T16:47:01+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listcounters-300x206.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Background Performance Counters","datePublished":"2011-12-06T16:47:01+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/"},"wordCount":618,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listcounters-300x206.png","keywords":["Get-Counter","Jobs","PerfMon","PowerShell","Start-Job"],"articleSection":["PowerShell v2.0","Train Signal","Windows Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/","name":"Background Performance Counters &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listcounters-300x206.png","datePublished":"2011-12-06T16:47:01+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listcounters.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/listcounters.png","width":"1164","height":"801"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1874\/background-performance-counters\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell v2.0","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},{"@type":"ListItem","position":2,"name":"Background Performance Counters"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":7471,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7471\/a-powershell-network-monitor\/","url_meta":{"origin":1874,"position":0},"title":"A PowerShell Network Monitor","author":"Jeffery Hicks","date":"May 12, 2020","format":false,"excerpt":"I hope you've been trying your hand at the scripting challenges being posted on the Iron Scripter website. The challenges are designed for individuals to do on their own to build up their PowerShell scripting skills. A few weeks ago, a challenge was posted to create a network monitoring tool\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/netperf-2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/netperf-2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/netperf-2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/netperf-2.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/netperf-2.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":6308,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6308\/ultimate-powershell-telemetry-prompt\/","url_meta":{"origin":1874,"position":1},"title":"The Ultimate PowerShell Telemetry Prompt","author":"Jeffery Hicks","date":"December 20, 2018","format":false,"excerpt":"Well, I knew I wouldn't be satisfied. The other day I shared a PowerShell prompt function that could display telemetry like information for a few remote servers. One of the drawbacks was the limited amount of information I could display. I've revised that function and have a new version that\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/12\/image_thumb-15.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/12\/image_thumb-15.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/12\/image_thumb-15.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/12\/image_thumb-15.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":7872,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7872\/better-performance-counters-with-powershell\/","url_meta":{"origin":1874,"position":2},"title":"Better Performance Counters with PowerShell","author":"Jeffery Hicks","date":"November 12, 2020","format":false,"excerpt":"I wanted to tell you about another addition to the latest release of the PSScriptTools module. This is something I've written about before but I decided to add the function to the module. I hope you find it a much easier way to work with performance counters. And it works\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/11\/counters-form.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/11\/counters-form.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/11\/counters-form.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/11\/counters-form.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":8143,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8143\/solving-the-powershell-memory-challenge\/","url_meta":{"origin":1874,"position":3},"title":"Solving the PowerShell Memory Challenge","author":"Jeffery Hicks","date":"February 8, 2021","format":false,"excerpt":"I hope you tried your hand at this Iron Scripter PowerShell challenge on reporting memory usage. The basic challenge was to find the total percent of working set memory that a specific process or service is using. Here's how I approached it, with my usual disclaimer that my solution is\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-wspct.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-wspct.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-wspct.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-wspct.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-wspct.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-wspct.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1750,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1750\/friday-fun-perf-counters-with-write-progress\/","url_meta":{"origin":1874,"position":4},"title":"Friday Fun Perf Counters with Write-Progress","author":"Jeffery Hicks","date":"November 11, 2011","format":false,"excerpt":"While working on my course for TrainSignal on managing Windows Servers with PowerShell, I came up with an interesting use of the Write-Progress cmdlet. I was working on the performance monitoring lesson and realized I could use Write-Progress as rudimentary graphing tool. The cmdlet has a parameter that lets you\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":337,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/337\/summary-judgment\/","url_meta":{"origin":1874,"position":5},"title":"Summary Judgment","author":"Jeffery Hicks","date":"August 21, 2009","format":false,"excerpt":"While working on a new article for REDMOND magazine about PowerShell 2.0, I wanted to get some cmdlet information. I wanted an easy way to see a list of cmdlets for a given verb or noun. Of course that is easily done with Get-Command. However this only gives my the\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1874"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1874\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}