{"id":2361,"date":"2012-06-01T08:58:29","date_gmt":"2012-06-01T12:58:29","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=2361"},"modified":"2012-06-01T08:58:29","modified_gmt":"2012-06-01T12:58:29","slug":"friday-fun-another-powershell-console-graph","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/","title":{"rendered":"Friday Fun: Another PowerShell Console Graph"},"content":{"rendered":"<p>Late last year I posted a demo script to <a href=\"http:\/\/bit.ly\/uV4NON\" title=\"Read the original post\" target=\"_blank\">create a horizontal bar graph<\/a> in the PowerShell console. I liked it and many of you did as well. But I also wanted to be able to create a vertical bar graph, ie one with columns. This is much trickier since you have to tell PowerShell exactly where to \"paint\" the graph.<\/p>\n<p>I've posted other articles on using the coordinates in the host and that is what I ended up doing for today's Friday Fun. This demo script only works in the PowerShell console. It will run in the ISE but you won't get the desired result. Let me post the code and then I'll go through a few things.<\/p>\n<p><code lang=\"PowerShell\"><br \/>\nParam([string]$computername=$env:computername)<\/p>\n<p>Clear-Host<\/p>\n<p>#get the data<br \/>\n$drives=Get-WmiObject -Class Win32_LogicalDisk -Filter \"drivetype=3\" -computername $computername<\/p>\n<p>#define a set of colors for the graphs<br \/>\n$colors=@(\"Yellow\",\"Magenta\",\"Green\",\"Cyan\",\"Red\")<\/p>\n<p>#set cursor position<br \/>\n$Coordinate = New-Object System.Management.Automation.Host.Coordinates<br \/>\n$Coordinate.X= 10<br \/>\n$Coordinate.Y= [int]($host.ui.rawui.WindowSize.Height -5)<\/p>\n<p>#save starting coordinates<br \/>\n$startY=$Coordinate.Y<br \/>\n$startX=$Coordinate.X<\/p>\n<p>#counter for colors<br \/>\n$c=0<\/p>\n<p>#adjust Y so we can write the caption<br \/>\n$Coordinate.Y+=1<\/p>\n<p>foreach ($drive in $drives) {<br \/>\n    #set the color to the first color in the array of colors<br \/>\n    $color=$colors[$c]<br \/>\n    $legend=$drive.DeviceID<br \/>\n    #calculate used space value<br \/>\n    $used=$Drive.Size - $Drive.FreeSpace<br \/>\n    [int]$usedValue=($used\/($drive.size))*10<br \/>\n    #adjust for values less than 0 so something gets graphed<br \/>\n    if ($usedValue -le 0) {<br \/>\n       [int]$usedValue=($used\/($drive.size))*50<br \/>\n    }<\/p>\n<p>    #format usage as a percentage<br \/>\n    $usedPer=\"{0:p2}\" -f ($used\/($drive.size))<br \/>\n    #set the cursor to the new coordinates<br \/>\n    $host.ui.rawui.CursorPosition=$Coordinate<br \/>\n    #write the caption<br \/>\n    write-host $legend -nonew<br \/>\n    #move the Y coordinate up to start the graph<br \/>\n    $coordinate.Y-=1<\/p>\n<p>    for ($i=$usedValue;$i -gt 0;$i--) {<br \/>\n      $host.ui.rawui.CursorPosition=$Coordinate<br \/>\n      #draw the color space for the graph<br \/>\n      write-host \"    \" -BackgroundColor $color -nonewline<br \/>\n      #move Y up 1<br \/>\n      $coordinate.y--<br \/>\n      #repeat until we reach the $usedValue<br \/>\n    }<br \/>\n    #set new coordinate<br \/>\n    $host.ui.rawui.CursorPosition=$Coordinate<br \/>\n    #write the usage percentage at the top of the bar<br \/>\n    write-host $usedPer -nonewline<\/p>\n<p>    #reset Y to where we started + 1<br \/>\n    $Coordinate.Y=($startY+1)<br \/>\n    #move X to the right<br \/>\n    $coordinate.x+=8<br \/>\n    #reset coordinates<br \/>\n    $host.ui.rawui.CursorPosition=$Coordinate<br \/>\n    #increment the color counter<br \/>\n    $c++<\/p>\n<p>    #repeat for the next drive<\/p>\n<p>} #foreach<\/p>\n<p>#reset coordinates so we can write a legend<br \/>\n$coordinate.Y=$StartY+2<br \/>\n$coordinate.X=$startX<br \/>\n$host.ui.rawui.CursorPosition=$Coordinate<br \/>\nwrite-host (\"Drive Usage for {0}\" -f $drives[0].__SERVER)<\/p>\n<p>#move cursor to bottom of the screen and write a blank line<br \/>\n$Coordinate.X=1<br \/>\n$coordinate.Y=[int]($host.ui.rawui.WindowSize.Height-2)<br \/>\n$host.ui.rawui.CursorPosition=$Coordinate<br \/>\nwrite-host \"\"<\/p>\n<p>#your PowerShell prompt will now be displayed<br \/>\n<\/code><\/p>\n<p>This script gets drive usage and creates a vertical bar chart displaying disk utilization. Everyone loves a good drive space report and  they always make good demos.<\/p>\n<p>The script creates a System.Management.Automation.Host.Coordinates object, setting the value of X and Y that should be starting in the bottom left corner of the console.<\/p>\n<p><code lang=\"PowerShell\"><br \/>\n#set cursor position<br \/>\n$Coordinate = New-Object System.Management.Automation.Host.Coordinates<br \/>\n$Coordinate.X= 10<br \/>\n$Coordinate.Y= [int]($host.ui.rawui.WindowSize.Height -5)<br \/>\n#save starting coordinates<br \/>\n$startY=$Coordinate.Y<br \/>\n$startX=$Coordinate.X<br \/>\n<\/code><\/p>\n<p>I'm also saving these values so I can reset. The script will have to \"move\" the cursor around the screen to draw the graphs. Once I calculate the values for each drive, I write a blank line using Write-Host with -Backgroundcolor to get the desired graphing effect.<\/p>\n<p><code lang=\"PowerShell\"><br \/>\nfor ($i=$usedValue;$i -gt 0;$i--) {<br \/>\n      $host.ui.rawui.CursorPosition=$Coordinate<br \/>\n      #draw the color space for the graph<br \/>\n      write-host \"    \" -BackgroundColor $color -nonewline<br \/>\n      #move Y up 1<br \/>\n      $coordinate.y--<br \/>\n      #repeat until we reach the $usedValue<br \/>\n    }<br \/>\n<\/code><\/p>\n<p>Notice after each write I move the Y point \"up\", until I reach the limit of the current value. I set values as a percentage scaled to 10 so the graph doesn't end up outside of the buffer.  I also made an adjustment for low values that wouldn't normally trigger a graph so that I get something written to the screen.<\/p>\n<p><code lang=\"PowerShell\"><br \/>\n #calculate used space value<br \/>\n    $used=$Drive.Size - $Drive.FreeSpace<br \/>\n    [int]$usedValue=($used\/($drive.size))*10<br \/>\n    #adjust for values less than 0 so something gets graphed<br \/>\n    if ($usedValue -le 0) {<br \/>\n       [int]$usedValue=($used\/($drive.size))*50<br \/>\n    }<br \/>\n<\/code><\/p>\n<p>After drawing the graph I move the cursor position back to the beginning and write a legend.<\/p>\n<p><code lang=\"PowerShell\"><br \/>\n#reset coordinates so we can write a legend<br \/>\n$coordinate.Y=$StartY+2<br \/>\n$coordinate.X=$startX<br \/>\n$host.ui.rawui.CursorPosition=$Coordinate<br \/>\nwrite-host (\"Drive Usage for {0}\" -f $drives[0].__SERVER)<br \/>\n<\/code><\/p>\n<p>Here's the end result.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/06\/demo-bargraph.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/06\/demo-bargraph-300x172.png\" alt=\"\" title=\"demo-bargraph\" width=\"300\" height=\"172\" class=\"aligncenter size-medium wp-image-2362\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/06\/demo-bargraph-300x172.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/06\/demo-bargraph.png 730w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>This script is really just a proof of concept. I haven't created any functions to simply any of this or make it easy to use with other values. This is also a bit advanced so if you look at this and it makes your head hurt, don't worry about it. You would only use something like this in special cases.  Still, I'd like to know what you think, how it works for you and if you extend it to a more re-usable form.<\/p>\n<p>Download <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/06\/demo-bargraph.txt' target='_blank'>demo-bargraph<\/a>. The script will default to the local computer, but you can run specify any computer you want.<\/p>\n<p><code lang=\"dos\"><br \/>\nPS C:\\Scripts\\> .\\demo-bargraph.ps1 Mycomputer<br \/>\n<\/code><\/p>\n<p>Enjoy and have fun.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Late last year I posted a demo script to create a horizontal bar graph in the PowerShell console. I liked it and many of you did as well. But I also wanted to be able to create a vertical bar graph, ie one with columns. This is much trickier since you have to tell PowerShell&#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":[271,4],"tags":[176,568,389,534,540],"class_list":["post-2361","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell","tag-console","tag-friday-fun","tag-graph","tag-powershell","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun: Another PowerShell Console Graph &#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\/2361\/friday-fun-another-powershell-console-graph\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun: Another PowerShell Console Graph &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Late last year I posted a demo script to create a horizontal bar graph in the PowerShell console. I liked it and many of you did as well. But I also wanted to be able to create a vertical bar graph, ie one with columns. This is much trickier since you have to tell PowerShell...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2012-06-01T12:58:29+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/06\/demo-bargraph-300x172.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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2361\\\/friday-fun-another-powershell-console-graph\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2361\\\/friday-fun-another-powershell-console-graph\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun: Another PowerShell Console Graph\",\"datePublished\":\"2012-06-01T12:58:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2361\\\/friday-fun-another-powershell-console-graph\\\/\"},\"wordCount\":426,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2361\\\/friday-fun-another-powershell-console-graph\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2012\\\/06\\\/demo-bargraph-300x172.png\",\"keywords\":[\"console\",\"Friday Fun\",\"graph\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"Friday Fun\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2361\\\/friday-fun-another-powershell-console-graph\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2361\\\/friday-fun-another-powershell-console-graph\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2361\\\/friday-fun-another-powershell-console-graph\\\/\",\"name\":\"Friday Fun: Another PowerShell Console Graph &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2361\\\/friday-fun-another-powershell-console-graph\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2361\\\/friday-fun-another-powershell-console-graph\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2012\\\/06\\\/demo-bargraph-300x172.png\",\"datePublished\":\"2012-06-01T12:58:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2361\\\/friday-fun-another-powershell-console-graph\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2361\\\/friday-fun-another-powershell-console-graph\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2361\\\/friday-fun-another-powershell-console-graph\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2012\\\/06\\\/demo-bargraph.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2012\\\/06\\\/demo-bargraph.png\",\"width\":\"730\",\"height\":\"419\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2361\\\/friday-fun-another-powershell-console-graph\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun: Another PowerShell Console Graph\"}]},{\"@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":"Friday Fun: Another PowerShell Console Graph &#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\/2361\/friday-fun-another-powershell-console-graph\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun: Another PowerShell Console Graph &#8226; The Lonely Administrator","og_description":"Late last year I posted a demo script to create a horizontal bar graph in the PowerShell console. I liked it and many of you did as well. But I also wanted to be able to create a vertical bar graph, ie one with columns. This is much trickier since you have to tell PowerShell...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/","og_site_name":"The Lonely Administrator","article_published_time":"2012-06-01T12:58:29+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/06\/demo-bargraph-300x172.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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun: Another PowerShell Console Graph","datePublished":"2012-06-01T12:58:29+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/"},"wordCount":426,"commentCount":3,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/06\/demo-bargraph-300x172.png","keywords":["console","Friday Fun","graph","PowerShell","Scripting"],"articleSection":["Friday Fun","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/","name":"Friday Fun: Another PowerShell Console Graph &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/06\/demo-bargraph-300x172.png","datePublished":"2012-06-01T12:58:29+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/06\/demo-bargraph.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/06\/demo-bargraph.png","width":"730","height":"419"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun: Another PowerShell Console Graph"}]},{"@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":1891,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1891\/friday-fun-drive-usage-console-graph\/","url_meta":{"origin":2361,"position":0},"title":"Friday Fun Drive Usage Console Graph","author":"Jeffery Hicks","date":"December 9, 2011","format":false,"excerpt":"I think you'll like this. Normally, I prefer my PowerShell commands to write objects to the pipeline. But there's nothing wrong with sending output directly to the console, as long as you know that the output is intended only for the screen. What I find frustrating is the use of\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\/2011\/12\/colordrivegraph-300x129.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":449,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/449\/drive-report-console-chart\/","url_meta":{"origin":2361,"position":1},"title":"Drive Report Console Chart","author":"Jeffery Hicks","date":"October 15, 2009","format":false,"excerpt":"In thinking about some of my recent posts, I realize I should make clear that these scripts and functions are not necessarily good PowerShell examples. They don\u2019t take advantage of objects and the pipeline. They are single purpose and one-dimensional. Not that there\u2019s anything wrong with that. My recent examples,\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"drivereport screenshot","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2009\/10\/drivereport_thumb.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":5512,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/","url_meta":{"origin":2361,"position":2},"title":"Friday Fun: Crossing the Border with PowerShell","author":"Jeffery Hicks","date":"March 24, 2017","format":false,"excerpt":"Today's Friday Fun post, as most of these are, is a little silly and a little educational. Because I obviously am avoiding getting any real work accomplished, I worked on a little project that would add a border around a string of text. I often write formatted text to the\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb-11.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb-11.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb-11.png?resize=525%2C300 1.5x"},"classes":[]},{"id":3573,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-3-0\/3573\/updated-console-graphing-in-powershell\/","url_meta":{"origin":2361,"position":3},"title":"Updated Console Graphing in PowerShell","author":"Jeffery Hicks","date":"December 9, 2013","format":false,"excerpt":"The other day Distinguished Engineer and PowerShell Godfather Jeffrey Snover posted a blog article about the evils of Write-Host. His take, which many agree with, is that Write-Host is a special case cmdlet. In his article he mentions console graphing as an example. I wrote such a script earlier this\u2026","rel":"","context":"In &quot;Powershell 3.0&quot;","block_context":{"text":"Powershell 3.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-3-0\/"},"img":{"alt_text":"out-consolegraph-3.1","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/12\/out-consolegraph-3.1-300x88.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1750,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1750\/friday-fun-perf-counters-with-write-progress\/","url_meta":{"origin":2361,"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":2697,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2697\/powershell-console-graphing-revised\/","url_meta":{"origin":2361,"position":5},"title":"PowerShell Console Graphing Revised","author":"Jeffery Hicks","date":"January 11, 2013","format":false,"excerpt":"Many of you have been having fun with my PowerShell Console Graphing tool I posted the other day. But I felt the need to make one more major tweak. I wanted to have the option for conditional formatting. That is, display graphed entries with high values in one color, medium\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"out-consolegraph-3","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-3-1024x816.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-3-1024x816.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-3-1024x816.png?resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2361","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=2361"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2361\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}