{"id":2679,"date":"2013-01-09T13:42:06","date_gmt":"2013-01-09T18:42:06","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=2679"},"modified":"2013-11-01T08:27:37","modified_gmt":"2013-11-01T12:27:37","slug":"graphing-with-the-powershell-console","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2679\/graphing-with-the-powershell-console\/","title":{"rendered":"Graphing with the PowerShell Console"},"content":{"rendered":"<p>I've written before about using the PowerShell console as a graphing tool, primarily using Write-Host. Most of what I've published before were really proof of concept. I decided to try and come up with a more formal and re-usable tool that could create a horizontal bar graph based on a numeric property from piped objects. For example, I wanted to get all processes and display a graph of the WorkingSet for each object. My result is an advanced function that should work in v2 or v3 called Out-ConsoleGraph.<\/p>\n<p>Here's the code, minus, the comment-based help. I've commented the quote quite a bit so I won't spend a lot of time explaining it in detail.<\/p>\n<pre class=\"lang:ps decode:true \" >Function Out-ConsoleGraph {\r\n\r\n#comment based help goes here\r\n\r\n[cmdletbinding()]\r\nParam (\r\n[parameter(Position=0,ValueFromPipeline=$True)]\r\n[object]$Inputobject,\r\n[parameter(Mandatory=$True,HelpMessage=\"Enter a property name to graph\")]\r\n[ValidateNotNullorEmpty()]\r\n[string]$Property,\r\n[string]$CaptionProperty=\"Name\",\r\n[string]$Title=\"$Property Report - $(Get-Date)\",\r\n[ValidateNotNullorEmpty()]\r\n[System.ConsoleColor]$GraphColor=\"Green\",\r\n[alias(\"cls\")]\r\n[switch]$ClearScreen\r\n)\r\n\r\nBegin {\r\n    Write-Verbose -Message \"Starting $($MyInvocation.Mycommand)\"  \r\n    #get the current window width so that our lines will be proportional\r\n    $Width = $Host.UI.RawUI.BufferSize.Width\r\n    Write-Verbose \"Width = $Width\"\r\n    \r\n    #initialize an array to hold data\r\n    $data=@()\r\n} #begin\r\n\r\nProcess {\r\n    #get the data\r\n    $data += $Inputobject\r\n\r\n} #end process\r\n\r\nEnd {\r\n    #get largest property value\r\n    Write-Verbose \"Getting largest value for $property\"\r\n    Try {\r\n        $largest = $data | sort $property | Select -ExpandProperty $property -last 1 -ErrorAction Stop\r\n        Write-Verbose $largest\r\n    }\r\n    Catch {\r\n        Write-Warning \"Failed to find property $property\"\r\n        Return\r\n    }\r\n    If ($largest) {\r\n        #get length of longest object property used for the caption so we can pad\r\n        #This must be a string so we can get the length\r\n        Write-Verbose \"Getting longest value for $CaptionProperty\"\r\n        $sample = $data |Sort @{Expression={($_.$CaptionProperty -as [string]).Length}} |\r\n        Select -last 1\r\n        Write-Verbose ($sample | out-string)\r\n        [int]$longest = ($sample.$CaptionProperty).ToString().length\r\n        Write-Verbose \"Longest caption is $longest\"\r\n\r\n        #get remaining available window width, dividing by 100 to get a \r\n        #proportional width. Subtract 4 to add a little margin.\r\n        $available = ($width-$longest-4)\/100\r\n        Write-Verbose \"Available value is $available\"\r\n    \r\n        if ($ClearScreen) {\r\n            Clear-Host\r\n        }\r\n        Write-Host \"$Title`n\"\r\n        foreach ($obj in $data) {\r\n            #define the caption\r\n            [string]$caption = $obj.$captionProperty\r\n\r\n            &lt;#\r\n             calculate the current property as a percentage of the largest \r\n             property in the set. Then multiply by the remaining window width\r\n            #&gt;\r\n            if ($obj.$property -eq 0) {\r\n                #if property is actually 0 then don't display anything for the graph\r\n                [int]$graph=0\r\n            }\r\n            else {\r\n                $graph = (($obj.$property)\/$largest)*100*$available\r\n            }\r\n            if ($graph -ge 2) {\r\n                [string]$g=[char]9608\r\n            }\r\n            elseif ($graph -gt 0 -AND $graph -le 1) {\r\n                #if graph value is &gt;0 and &lt;1 then use a short graph character\r\n                [string]$g=[char]9612\r\n                #adjust the value so something will be displayed\r\n                $graph=1\r\n            }\r\n            \r\n            Write-Verbose \"Graph value is $graph\"\r\n            Write-Verbose \"Property value is $($obj.$property)\"\r\n            Write-Host $caption.PadRight($longest) -NoNewline\r\n            #add some padding between the caption and the graph\r\n            Write-Host \"  \" -NoNewline\r\n            Write-Host ($g*$graph) -ForegroundColor $GraphColor\r\n        } #foreach\r\n           #add a blank line\r\n           Write-Host `n\r\n    } #if $largest\r\n    Write-Verbose -Message \"Ending $($MyInvocation.Mycommand)\"\r\n} #end\r\n\r\n} #end Out-ConsoleGraph\r\n<\/pre>\n<p>The function requires that PowerShell be running in STA mode, which shouldn't really be an issue. The intent is that you will be piping objects to the function. You need to specify a property that you want to graph and an object property to use as the label or caption for each object. The default caption is the Name property which seems pretty common.  The property you are graphing must have a numeric value. The function's premise is to get the window width, then write the caption and a graph figure using the remaining available width. The function has a bit of code to calculate the longest caption value so that everything lines up and then determines how much space remains for graphing. <\/p>\n<p>The graph is really more of a proportional representation as opposed to actual value. In short, I find the largest property value which essentially becomes the 100% mark. All other values are calculated as percentages and graphed accordingly. This might be easier to understand if you see it in action.<\/p>\n<pre class=\"lang:batch decode:true \" >PS Scripts:\\&gt; get-process | where {$_.company -notmatch \"microsoft\"} | out-consolegraph -property WorkingSet -cls<\/pre>\n<p>This is getting all non-Microsoft processes and creating a graph of the WorkingSet property.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-1-1024x735.png\" alt=\"out-consolegraph-1\" width=\"625\" height=\"448\" class=\"aligncenter size-large wp-image-2680\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-1-1024x735.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-1-300x215.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-1-624x448.png 624w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-1.png 1137w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p>The graph title and color are customizable via parameters. This should work for any type of object as long as you can have a numeric property.<\/p>\n<pre class=\"lang:ps decode:true \" >Get-ChildItem C:\\Scripts -Directory | foreach {\r\n  $data = Get-ChildItem $_.FullName -Recurse -File | Measure-Object -Property Length -sum\r\n  $_ | Select Name,@{Name=\"Size\";Expression={$data.sum}}\r\n} | Out-ConsoleGraph -Property Size -Title \"Scripts Folder Report\" -GraphColor Cyan\r\n<\/pre>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-21.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-21-1024x525.png\" alt=\"out-consolegraph-2\" width=\"625\" height=\"320\" class=\"aligncenter size-large wp-image-2686\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-21-1024x525.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-21-300x153.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-21-624x319.png 624w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-21.png 1137w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p>This command will work in the PowerShell ISE but I think it works better in the PowerShell console. Remember, this command is NOT writing to the pipeline so all you can do is view the output.<\/p>\n<p>Download <a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/Out-ConsoleGraph.txt\" target='_blank'>Out-ConsoleGraph<\/a> and let me know what you think.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve written before about using the PowerShell console as a graphing tool, primarily using Write-Host. Most of what I&#8217;ve published before were really proof of concept. I decided to try and come up with a more formal and re-usable tool that could create a horizontal bar graph based on a numeric property from piped objects&#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":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,8],"tags":[176,413,534,101],"class_list":["post-2679","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-console","tag-graphing","tag-powershell","tag-write-host"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Graphing with the PowerShell Console &#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\/2679\/graphing-with-the-powershell-console\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Graphing with the PowerShell Console &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I&#039;ve written before about using the PowerShell console as a graphing tool, primarily using Write-Host. Most of what I&#039;ve published before were really proof of concept. I decided to try and come up with a more formal and re-usable tool that could create a horizontal bar graph based on a numeric property from piped objects....\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/2679\/graphing-with-the-powershell-console\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2013-01-09T18:42:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-11-01T12:27:37+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-1-1024x735.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\\\/2679\\\/graphing-with-the-powershell-console\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2679\\\/graphing-with-the-powershell-console\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Graphing with the PowerShell Console\",\"datePublished\":\"2013-01-09T18:42:06+00:00\",\"dateModified\":\"2013-11-01T12:27:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2679\\\/graphing-with-the-powershell-console\\\/\"},\"wordCount\":383,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2679\\\/graphing-with-the-powershell-console\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/01\\\/out-consolegraph-1-1024x735.png\",\"keywords\":[\"console\",\"Graphing\",\"PowerShell\",\"Write-Host\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2679\\\/graphing-with-the-powershell-console\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2679\\\/graphing-with-the-powershell-console\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2679\\\/graphing-with-the-powershell-console\\\/\",\"name\":\"Graphing with the PowerShell Console &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2679\\\/graphing-with-the-powershell-console\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2679\\\/graphing-with-the-powershell-console\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/01\\\/out-consolegraph-1-1024x735.png\",\"datePublished\":\"2013-01-09T18:42:06+00:00\",\"dateModified\":\"2013-11-01T12:27:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2679\\\/graphing-with-the-powershell-console\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2679\\\/graphing-with-the-powershell-console\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2679\\\/graphing-with-the-powershell-console\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/01\\\/out-consolegraph-1.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/01\\\/out-consolegraph-1.png\",\"width\":1137,\"height\":817},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2679\\\/graphing-with-the-powershell-console\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Graphing with the PowerShell Console\"}]},{\"@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":"Graphing with the PowerShell Console &#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\/2679\/graphing-with-the-powershell-console\/","og_locale":"en_US","og_type":"article","og_title":"Graphing with the PowerShell Console &#8226; The Lonely Administrator","og_description":"I've written before about using the PowerShell console as a graphing tool, primarily using Write-Host. Most of what I've published before were really proof of concept. I decided to try and come up with a more formal and re-usable tool that could create a horizontal bar graph based on a numeric property from piped objects....","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2679\/graphing-with-the-powershell-console\/","og_site_name":"The Lonely Administrator","article_published_time":"2013-01-09T18:42:06+00:00","article_modified_time":"2013-11-01T12:27:37+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-1-1024x735.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\/2679\/graphing-with-the-powershell-console\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2679\/graphing-with-the-powershell-console\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Graphing with the PowerShell Console","datePublished":"2013-01-09T18:42:06+00:00","dateModified":"2013-11-01T12:27:37+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2679\/graphing-with-the-powershell-console\/"},"wordCount":383,"commentCount":2,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2679\/graphing-with-the-powershell-console\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-1-1024x735.png","keywords":["console","Graphing","PowerShell","Write-Host"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/2679\/graphing-with-the-powershell-console\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2679\/graphing-with-the-powershell-console\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2679\/graphing-with-the-powershell-console\/","name":"Graphing with the PowerShell Console &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2679\/graphing-with-the-powershell-console\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2679\/graphing-with-the-powershell-console\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-1-1024x735.png","datePublished":"2013-01-09T18:42:06+00:00","dateModified":"2013-11-01T12:27:37+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2679\/graphing-with-the-powershell-console\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/2679\/graphing-with-the-powershell-console\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2679\/graphing-with-the-powershell-console\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-1.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-1.png","width":1137,"height":817},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2679\/graphing-with-the-powershell-console\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Graphing with the PowerShell Console"}]},{"@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":2704,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2704\/powershell-graphing-with-out-gridview\/","url_meta":{"origin":2679,"position":0},"title":"PowerShell Graphing with Out-Gridview","author":"Jeffery Hicks","date":"January 14, 2013","format":false,"excerpt":"I've received a lot of interest for my last few posts on graphing with the PowerShell console. But I decided I could add one more feature. Technically it might have made more sense to turn this into a separate function, but I decided to simply modify the last version of\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-gv","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-gv-1024x548.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-gv-1024x548.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/out-consolegraph-gv-1024x548.png?resize=525%2C300 1.5x"},"classes":[]},{"id":2697,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2697\/powershell-console-graphing-revised\/","url_meta":{"origin":2679,"position":1},"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":[]},{"id":3573,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-3-0\/3573\/updated-console-graphing-in-powershell\/","url_meta":{"origin":2679,"position":2},"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":2689,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2689\/powershell-screen-shots\/","url_meta":{"origin":2679,"position":3},"title":"PowerShell Screen Shots","author":"Jeffery Hicks","date":"January 10, 2013","format":false,"excerpt":"Yesterday I posted a tool that creates a console-based graph. That command uses Write-Host which means nothing is sent to the pipeline. The only way you can really save the result is with a screen capture. Of course, you can manually use whatever screen capture program you like. If you\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"screenshot","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/screen-1024x703.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/screen-1024x703.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/screen-1024x703.png?resize=525%2C300 1.5x"},"classes":[]},{"id":2361,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2361\/friday-fun-another-powershell-console-graph\/","url_meta":{"origin":2679,"position":4},"title":"Friday Fun: Another PowerShell Console Graph","author":"Jeffery Hicks","date":"June 1, 2012","format":false,"excerpt":"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\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/06\/demo-bargraph-300x172.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1891,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1891\/friday-fun-drive-usage-console-graph\/","url_meta":{"origin":2679,"position":5},"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":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2679","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=2679"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2679\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}