{"id":904,"date":"2010-09-03T09:29:09","date_gmt":"2010-09-03T13:29:09","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=904"},"modified":"2011-03-28T08:24:27","modified_gmt":"2011-03-28T12:24:27","slug":"friday-fun-color-my-world","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/","title":{"rendered":"Friday Fun: Color My World"},"content":{"rendered":"<p>The end of another work week and time for a little PowerShell fun. When I first started using PowerShell, I was fascinated by Write-Host and the ability to write colorized text to the console. Visions of ANSI art danced in my head, but I've moved on. Using colors with Write-Host is a great thing, and something I actually encourage. Because Write-Host doesn't write to the pipeline, it can be confusing. My recommendation is to use Write-Output, or its alias Write, to send objects to the pipeline. Use Write-Host to display messages to the person running the script or function and colorize it so you can distinguish it from pipelined output. But what colors can I use? What do they look like? What about the combination for foreground and background colors? This week's Friday Fun will help.<!--more--><\/p>\n<p>The color choices that Write-Host uses come from an enumeration of the .NET [System.ConsoleColors] class. If you know how to use .NET in PowerShell, you can get this enumeration yourself. Don't feel bad if this looks like programming.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nPS S:\\> [enum]::GetNames([system.consolecolor])<br \/>\nBlack<br \/>\nDarkBlue<br \/>\nDarkGreen<br \/>\nDarkCyan<br \/>\nDarkRed<br \/>\nDarkMagenta<br \/>\nDarkYellow<br \/>\nGray<br \/>\nDarkGray<br \/>\nBlue<br \/>\nGreen<br \/>\nCyan<br \/>\nRed<br \/>\nMagenta<br \/>\nYellow<br \/>\nWhite<br \/>\n[\/cc]<\/p>\n<p>That's a good start. But what does DarkCyan look like? I put together a short script called Demo-Color.ps1.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nParam(<br \/>\n[switch]$ListOnly,<br \/>\n[switch]$combo)<\/p>\n<p>#enumerate color options for the current console<br \/>\n$colors=[System.Enum]::GetNames([System.ConsoleColor])<\/p>\n<p>if ($ListOnly) {<br \/>\n    #display a sorted list of colors<br \/>\n    $colors | Sort<br \/>\n}<br \/>\nElse {<br \/>\n    #Demo color samples<br \/>\n    Clear-Host<\/p>\n<p>    if ($combo) { #cycle through all background and foreground combinations<br \/>\n     for ($i=0;$i -lt $colors.count;$i++) {<br \/>\n         for ($j=0;$j -lt $colors.count;$j++) {<br \/>\n            if ($colors[$i] -ne $colors[$j]) {<br \/>\n                $msg=\"{0} on {1}\" -f $colors[$i],$colors[$j]<br \/>\n                Write-Host $msg -foregroundcolor $colors[$i] -backgroundcolor $colors[$j]<br \/>\n            } #if<br \/>\n        } #for $j<br \/>\n     } #for $i<br \/>\n    } #if $combo<br \/>\n    else {<br \/>\n        #show the list of colors<br \/>\n        for ($i=0;$i -lt $colors.count;$i++) {<br \/>\n            Write-Host \" $($colors[$i])   \" -BackgroundColor $colors[$i]<br \/>\n        } #for<br \/>\n    } #else<br \/>\n} #else no $ListOnly<br \/>\n[\/cc]<\/p>\n<p>The script uses the same enumeration to get all available colors. If you run the script with the -ListOnly parameter, it will return a sorted list of color options.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nPS S:\\> .\\demo-color -list<br \/>\nBlack<br \/>\nDarkBlue<br \/>\nDarkGreen<br \/>\nDarkCyan<br \/>\nDarkRed<br \/>\nDarkMagenta<br \/>\nDarkYellow<br \/>\nGray<br \/>\nDarkGray<br \/>\nBlue<br \/>\nGreen<br \/>\nCyan<br \/>\nRed<br \/>\nMagenta<br \/>\nYellow<br \/>\nWhite<br \/>\n[\/cc]<br \/>\nBut the best way to use it is without any parameters. This will run through the list of colors, using a For loop and Write-Host to display each one.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n for ($i=0;$i -lt $colors.count;$i++) {<br \/>\n            Write-Host \" $($colors[$i])   \" -BackgroundColor $colors[$i]<br \/>\n        } #for<br \/>\n[\/cc]<br \/>\n<a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/color-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/color-1.png\" alt=\"\" title=\"color-1\" width=\"541\" height=\"381\" class=\"aligncenter size-full wp-image-906\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/color-1.png 541w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/color-1-300x211.png 300w\" sizes=\"auto, (max-width: 541px) 100vw, 541px\" \/><\/a><br \/>\nBut you might also be curious about color combinations. Use the -Combo switch and the script will cycle through every combination of foreground and background color using a set of nested For loops.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n for ($i=0;$i -lt $colors.count;$i++) {<br \/>\n         for ($j=0;$j -lt $colors.count;$j++) {<br \/>\n            if ($colors[$i] -ne $colors[$j]) {<br \/>\n                $msg=\"{0} on {1}\" -f $colors[$i],$colors[$j]<br \/>\n                Write-Host $msg -foregroundcolor $colors[$i] -backgroundcolor $colors[$j]<br \/>\n            } #if<br \/>\n        } #for $j<br \/>\n     } #for $i<br \/>\n[\/cc]<\/p>\n<p>I'll let you run it yourself to see the results. What I like about this is that I can check color combinations and find  something that works best in the console and ISE.  Some colors just don't work in the ISE very well. Of course, if you've changed your console's background color, you'll get even different results.<\/p>\n<p>Download <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/demo-color.txt'>demo-color.ps1<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The end of another work week and time for a little PowerShell fun. When I first started using PowerShell, I was fascinated by Write-Host and the ability to write colorized text to the console. Visions of ANSI art danced in my head, but I&#8217;ve moved on. Using colors with Write-Host is a great thing, and&#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,61,4],"tags":[230,534,540],"class_list":["post-904","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-miscellaneous","category-powershell","tag-fridayfun","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: Color My World &#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\/904\/friday-fun-color-my-world\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun: Color My World &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"The end of another work week and time for a little PowerShell fun. When I first started using PowerShell, I was fascinated by Write-Host and the ability to write colorized text to the console. Visions of ANSI art danced in my head, but I&#039;ve moved on. Using colors with Write-Host is a great thing, and...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2010-09-03T13:29:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2011-03-28T12:24:27+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/color-1.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\\\/904\\\/friday-fun-color-my-world\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/904\\\/friday-fun-color-my-world\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun: Color My World\",\"datePublished\":\"2010-09-03T13:29:09+00:00\",\"dateModified\":\"2011-03-28T12:24:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/904\\\/friday-fun-color-my-world\\\/\"},\"wordCount\":584,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/904\\\/friday-fun-color-my-world\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2010\\\/09\\\/color-1.png\",\"keywords\":[\"FridayFun\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"Friday Fun\",\"Miscellaneous\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/904\\\/friday-fun-color-my-world\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/904\\\/friday-fun-color-my-world\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/904\\\/friday-fun-color-my-world\\\/\",\"name\":\"Friday Fun: Color My World &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/904\\\/friday-fun-color-my-world\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/904\\\/friday-fun-color-my-world\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2010\\\/09\\\/color-1.png\",\"datePublished\":\"2010-09-03T13:29:09+00:00\",\"dateModified\":\"2011-03-28T12:24:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/904\\\/friday-fun-color-my-world\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/904\\\/friday-fun-color-my-world\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/904\\\/friday-fun-color-my-world\\\/#primaryimage\",\"url\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2010\\\/09\\\/color-1.png\",\"contentUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2010\\\/09\\\/color-1.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/904\\\/friday-fun-color-my-world\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun: Color My World\"}]},{\"@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: Color My World &#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\/904\/friday-fun-color-my-world\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun: Color My World &#8226; The Lonely Administrator","og_description":"The end of another work week and time for a little PowerShell fun. When I first started using PowerShell, I was fascinated by Write-Host and the ability to write colorized text to the console. Visions of ANSI art danced in my head, but I've moved on. Using colors with Write-Host is a great thing, and...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/","og_site_name":"The Lonely Administrator","article_published_time":"2010-09-03T13:29:09+00:00","article_modified_time":"2011-03-28T12:24:27+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/color-1.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\/904\/friday-fun-color-my-world\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun: Color My World","datePublished":"2010-09-03T13:29:09+00:00","dateModified":"2011-03-28T12:24:27+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/"},"wordCount":584,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/color-1.png","keywords":["FridayFun","PowerShell","Scripting"],"articleSection":["Friday Fun","Miscellaneous","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/","name":"Friday Fun: Color My World &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/color-1.png","datePublished":"2010-09-03T13:29:09+00:00","dateModified":"2011-03-28T12:24:27+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/#primaryimage","url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/color-1.png","contentUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/09\/color-1.png"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/904\/friday-fun-color-my-world\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun: Color My World"}]},{"@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":1069,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1069\/friday-fun-out-rainbow\/","url_meta":{"origin":904,"position":0},"title":"Friday Fun Out-Rainbow","author":"Jeffery Hicks","date":"January 21, 2011","format":false,"excerpt":"For my readers who are just discovering my Friday posts, let me remind you that these are not necessarily practical, production worthy PowerShell scripts and functions. They are meant to be fun, yet educational. For example, in today's Friday Fun I have a function that takes string input and writes\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\/2011\/01\/out-rainbow-1-1024x412.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/01\/out-rainbow-1-1024x412.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/01\/out-rainbow-1-1024x412.png?resize=525%2C300 1.5x"},"classes":[]},{"id":3912,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3912\/friday-fun-a-random-powershell-console\/","url_meta":{"origin":904,"position":1},"title":"Friday Fun: A Random PowerShell Console","author":"Jeffery Hicks","date":"July 11, 2014","format":false,"excerpt":"This week I thought we'd have a little fun with the PowerShell console and maybe pick up a few scripting techniques along the way. Today I have a function that changes the foreground and background colors of your PowerShell console to random values. But because you might want to go\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"crayons","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/crayons-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2002,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/2002\/friday-fun-output-to-2-places-in-1\/","url_meta":{"origin":904,"position":2},"title":"Friday Fun: Output to 2 Places in 1","author":"Jeffery Hicks","date":"January 13, 2012","format":false,"excerpt":"Today's Friday Fun comes out of a short exchange I had yesterday with Hal Rottenberg on Google Plus. We were playing around with piping a PowerShell command to Clip.exe which dumps the output to the Windows Clipboard. I got to thinking about taking this a step further based on my\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\/01\/out-tee-1-300x141.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3462,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3462\/friday-fun-out-conditionalcolor\/","url_meta":{"origin":904,"position":3},"title":"Friday Fun: Out-ConditionalColor","author":"Jeffery Hicks","date":"September 27, 2013","format":false,"excerpt":"Last week I posted a Friday Fun article on parsing results from Invoke-Webrequest and displaying matching strings in color so that the book titles I'm interested in stand out. But the more I thought about it I realized I should take this a step further. The problem with Write-Host is\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"occ-basic","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/09\/occ-basic-1024x638.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/09\/occ-basic-1024x638.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/09\/occ-basic-1024x638.png?resize=525%2C300 1.5x"},"classes":[]},{"id":3804,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3804\/friday-fun-send-a-colorful-message\/","url_meta":{"origin":904,"position":4},"title":"Friday Fun Send a Colorful Message","author":"Jeffery Hicks","date":"April 18, 2014","format":false,"excerpt":"Next week is Pluralsight's 10th anniversary. In preparing for that happy event, I wanted to send a special greeting. Of course, because my courses are on PowerShell it only seemed appropriate to use PowerShell to display my message. In fact, let's jump right to the result. Here's how I did\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"HappyBirthdayPluralsight","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/04\/HappyBirthdayPluralsight-1024x355.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":5958,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5958\/friday-fun-perk-up-your-powershell-prompt\/","url_meta":{"origin":904,"position":5},"title":"Friday Fun: Perk Up Your PowerShell Prompt","author":"Jeffery Hicks","date":"April 6, 2018","format":false,"excerpt":"I haven't written a Friday Fun post in quite a while. Often these posts don't have much practical value but hopefully illustrate a concept or technique. Although what I have today is something you could use immediately. I have a version of a PowerShell prompt function that will color code\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\/2018\/04\/pslocationprompt-2_thumb.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/04\/pslocationprompt-2_thumb.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/04\/pslocationprompt-2_thumb.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/904","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=904"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/904\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}