{"id":5512,"date":"2017-03-24T12:09:01","date_gmt":"2017-03-24T16:09:01","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=5512"},"modified":"2017-03-24T12:09:01","modified_gmt":"2017-03-24T16:09:01","slug":"friday-fun-crossing-the-border-with-powershell","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/","title":{"rendered":"Friday Fun: Crossing the Border with PowerShell"},"content":{"rendered":"<p>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 screen to display information and thought it would be nice to be able to add sometime of border.<\/p>\n<p><!--more--><\/p>\n<p>My goal was to take a string like \"Friday Fun\" and write it to the console centered in a bordered box - something like this:<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">**************\r\n* Friday Fun *\r\n**************\r\n<\/pre>\n<p>I had to get the length of the string and add 2 to it to allow for a space on either side. The top and bottom lines were as simple as writing the character times the length.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">\"*\"*20\r\n<\/pre>\n<p>The middle part was simply a matter of concatenating the character and the text.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$body = \"$Character $text $Character\"\r\n<\/pre>\n<p>I then used a here string to create the final result.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">#define a here string with the final result\r\n$out = @\"\r\n$tabs$line\r\n$tabs$body\r\n$tabs$line\r\n\"@\r\n<\/pre>\n<p>And yes, I included a feature where the result could be tabbed or indented a certain number of times. You can find the complete function as a Github gist.<\/p>\n<p>https:\/\/gist.github.com\/jdhitsolutions\/0bbd6b64c107d7da23e65359c4d0e25c<\/p>\n<p>Here are some examples of the function in action.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image-11.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb-11.png\" alt=\"image\" width=\"644\" height=\"154\" border=\"0\" \/><\/a><\/p>\n<p>You can border any single line of text. For example, I have a short function to get some basic system information.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">Function Get-Status {\r\n    [cmdletbinding()]\r\n    Param(\r\n        [string]$Computername = $env:computername,\r\n        [switch]$AsString\r\n        )\r\n    $OS = Get-Ciminstance -ClassName Win32_OperatingSystem -ComputerName $computername\r\n    $uptime = (Get-Date) - $OS.lastBootUpTime\r\n    $pctFreeMem = ($os.FreePhysicalMemory \/ $os.TotalVisibleMemorySize)*100\r\n    $CDrive = Get-CimInstance -ClassName Win32_LogicalDisk -Filter \"deviceid='c:'\" -ComputerName $computername\r\n    $pctFreeC = ($CDrive.FreeSpace\/$CDrive.size)*100\r\n    $status = [PSCustomObject]@{\r\n        Computername = $OS.pscomputername\r\n        Uptime = $uptime\r\n        PctFreeC = [math]::Round($pctFreeC,2)\r\n        PctFreeMem = [math]::Round($pctFreeMem,2)\r\n    }\r\n    if ($AsString) {\r\n        \"{0} Uptime:{1} %FreeC:{2} %FreeMem:{3}\" -f $status.computername,$status.uptime,$status.PctFreeC,$status.PctFreeMem \r\n    }\r\n    else {\r\n        $status\r\n    }\r\n}\r\n<\/pre>\n<p>I included a parameter to write the result as a formatted string. I can now put a line like this in my PowerShell profile script:<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">. C:\\scripts\\GetStat.ps1\r\n. C:\\scripts\\Add-Border.ps1\r\n\r\ncls\r\nwrite-host \"`n\"\r\nget-status -AsString | add-border | write-host -ForegroundColor Green\r\nwrite-host \"Time to get to work, Jeff.\" -ForegroundColor yellow\r\nwrite-host \"`n\"\r\ncd c:\\\r\n<\/pre>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image-12.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb-12.png\" alt=\"image\" width=\"644\" height=\"188\" border=\"0\" \/><\/a><\/p>\n<p>Perhaps you can think of other fun ways to add borders to your script or command output. If so, I'd love to hear about it. Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today&#8217;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 screen to display information 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":"New on the blog - Friday Fun: Crossing the Border with #PowerShell","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":[271,4],"tags":[534,540],"class_list":["post-5512","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell","tag-powershell","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun: Crossing the Border with PowerShell &#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\/5512\/friday-fun-crossing-the-border-with-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun: Crossing the Border with PowerShell &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Today&#039;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 screen to display information and...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2017-03-24T16:09:01+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb-11.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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5512\\\/friday-fun-crossing-the-border-with-powershell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5512\\\/friday-fun-crossing-the-border-with-powershell\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun: Crossing the Border with PowerShell\",\"datePublished\":\"2017-03-24T16:09:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5512\\\/friday-fun-crossing-the-border-with-powershell\\\/\"},\"wordCount\":288,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5512\\\/friday-fun-crossing-the-border-with-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/03\\\/image_thumb-11.png\",\"keywords\":[\"PowerShell\",\"Scripting\"],\"articleSection\":[\"Friday Fun\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5512\\\/friday-fun-crossing-the-border-with-powershell\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5512\\\/friday-fun-crossing-the-border-with-powershell\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5512\\\/friday-fun-crossing-the-border-with-powershell\\\/\",\"name\":\"Friday Fun: Crossing the Border with PowerShell &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5512\\\/friday-fun-crossing-the-border-with-powershell\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5512\\\/friday-fun-crossing-the-border-with-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/03\\\/image_thumb-11.png\",\"datePublished\":\"2017-03-24T16:09:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5512\\\/friday-fun-crossing-the-border-with-powershell\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5512\\\/friday-fun-crossing-the-border-with-powershell\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5512\\\/friday-fun-crossing-the-border-with-powershell\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/03\\\/image_thumb-11.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/03\\\/image_thumb-11.png\",\"width\":644,\"height\":154},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5512\\\/friday-fun-crossing-the-border-with-powershell\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun: Crossing the Border with PowerShell\"}]},{\"@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: Crossing the Border with PowerShell &#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\/5512\/friday-fun-crossing-the-border-with-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun: Crossing the Border with PowerShell &#8226; The Lonely Administrator","og_description":"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 screen to display information and...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/","og_site_name":"The Lonely Administrator","article_published_time":"2017-03-24T16:09:01+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb-11.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":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun: Crossing the Border with PowerShell","datePublished":"2017-03-24T16:09:01+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/"},"wordCount":288,"commentCount":2,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb-11.png","keywords":["PowerShell","Scripting"],"articleSection":["Friday Fun","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/","name":"Friday Fun: Crossing the Border with PowerShell &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb-11.png","datePublished":"2017-03-24T16:09:01+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb-11.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb-11.png","width":644,"height":154},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun: Crossing the Border with PowerShell"}]},{"@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":940,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/940\/friday-fun-playing-with-strings\/","url_meta":{"origin":5512,"position":0},"title":"Friday Fun Playing with Strings","author":"Jeffery Hicks","date":"September 17, 2010","format":false,"excerpt":"While I was busy working, it turned into Friday which means time for a little PowerShell fun. I can't say you'll find any deep, meaningful, production use from today's post, but you might pick up a few techniques, which is really the point. Today we're going to have some fun\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":"","width":0,"height":0},"classes":[]},{"id":2450,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2450\/friday-fun-powershell-crypto\/","url_meta":{"origin":5512,"position":1},"title":"Friday Fun PowerShell Crypto","author":"Jeffery Hicks","date":"July 20, 2012","format":false,"excerpt":"I'm a big fan of codes, ciphers and secret messages. I obviously am a big PowerShell fan as well. So why not mash these things together? Today's Friday Fun is a PowerShell module I call PSCode. The module contains a few functions for encoding and decoding text. Now, before you\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\/07\/pscode-1-300x101.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1307,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1307\/friday-fun-powershell-pep-talk\/","url_meta":{"origin":5512,"position":2},"title":"Friday Fun PowerShell Pep Talk","author":"Jeffery Hicks","date":"April 1, 2011","format":false,"excerpt":"Today's Friday Fun is meant to help get you excited about the upcoming Scripting Games. I want to add a little pep to your PowerShell prompt. Perhaps it will even keep you motivated. What I have for you today are variety of prompt functions. Consider them variations on a theme.\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"PowerShell Pep Talk","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/04\/color-pep-prompt-300x144.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2425,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2425\/friday-fun-expand-environmental-variables-in-powershell-strings\/","url_meta":{"origin":5512,"position":3},"title":"Friday Fun: Expand Environmental Variables in PowerShell Strings","author":"Jeffery Hicks","date":"June 29, 2012","format":false,"excerpt":"This week I was working on a project that involved using the %PATH% environmental variable. The challenge was that I have some entries that look like this: %SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\. When I try to use that path in PowerShell, it complains because it doesn't expand %SystemRoot%. What I needed was a way\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/06\/powershellvariable-300x71.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":8821,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8821\/friday-fun-redacting-with-powershell\/","url_meta":{"origin":5512,"position":4},"title":"Friday Fun: Redacting with PowerShell","author":"Jeffery Hicks","date":"January 28, 2022","format":false,"excerpt":"It has been a while since my last Friday Fun post. These are articles that use PowerShell in fun and off-beat ways. The goal is to demonstrate techniques and concepts not necessarily give you something ready for production. Today, I'm going to modify PowerShell output to hide, or redact, potentially\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\/2022\/01\/or-3.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/or-3.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/or-3.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1849,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/1849\/friday-fun-a-christmas-prompt\/","url_meta":{"origin":5512,"position":5},"title":"Friday Fun &#8211; A Christmas Prompt","author":"Jeffery Hicks","date":"November 25, 2011","format":false,"excerpt":"Over the last few weeks I've read about other people's PowerShell prompts and offered a few suggestions of my own. This week's Friday Fun creates colorful holiday prompt that counts down the number of days until Christmas. The function, uses a simple timespan object as part of the prompt. 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":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/11\/christmasprompt-300x106.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5512","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=5512"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5512\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=5512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=5512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=5512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}