{"id":1660,"date":"2011-09-23T10:00:30","date_gmt":"2011-09-23T14:00:30","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1660"},"modified":"2013-09-13T08:37:20","modified_gmt":"2013-09-13T12:37:20","slug":"friday-fun-what-a-char","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1660\/friday-fun-what-a-char\/","title":{"rendered":"Friday Fun What a CHAR!"},"content":{"rendered":"<p>Last week I posted a PowerShell snippet on Twitter. My original post piped an array of integers as [CHAR] type using an OFS. Don't worry about that. As many people reminded me, it is much easier to use the -Join operator.<\/p>\n<pre class=\"lang:ps decode:true\">-join [char[]](116,103,105,102)<\/pre>\n<p>I'll let you try that on your own. The [CHAR] type is used to represent a character as an integer value, like this:<\/p>\n<pre class=\"lang:batch decode:true crayon-selected\">PS C:\\&gt; [char]120\r\nx<\/pre>\n<p><span style=\"line-height: 1.714285714; font-size: 1rem;\">For this week's Friday Fun I thought it would be nice to translate a string of text into corresponding character values. It looks like a secret code! Or we could use the translation in a join scriptblock. So I put together a little script I call Translate-ToChar.ps1. The script takes a string of text and writes an array of [CHAR] objects.<\/span><\/p>\n<pre class=\"lang:ps decode:true\">Param(\r\n[Parameter(Position=0)]\r\n[ValidateNotNullOrEmpty()]\r\n[string]$Text=\"PowerShell Rocks!\",\r\n[switch]$Scriptblock\r\n)\r\n\r\n#create CHAR mapping hash table\r\n$map=@{}\r\n33..125 | foreach { $map.Add([string]$_,[char]$_)}\r\n\r\n#create an empty array to hold the CHAR values\r\n$values=@()\r\n$text.ToCharArray() | foreach {\r\n#because $_ will change, save the current piped in character as a variable\r\n$ltr=$_\r\n[int]$i=($map.getEnumerator() | where {$_.value -ceq $ltr }).Name\r\n#add the value to the array\r\n$values+=$i\r\n}\r\n\r\nif ($ScriptBlock) {\r\n#write a scriptblock to the pipeline\r\n#create the command\r\n$ofs=\",\"\r\n#create a variable so we variable expansion of $values\r\n$t=\"-join [char[]]($values)\"\r\n\r\n#put it back together as a script block and write to the pipeline\r\n[scriptblock]::Create($t)\r\n}\r\nelse {\r\n#write value array\r\n$values\r\n}<\/pre>\n<p>The script begins by defining a map hash table for what I think are all characters you are likely to find on a US keyboard. These should be character values 33 through 125 which I get using the range (..) operator.<\/p>\n<pre class=\"lang:ps decode:true\">$map=@{}\r\n33..125 | foreach { $map.Add([string]$_,[char]$_)}<\/pre>\n<p>Each number is piped to ForEach object where I add it to the hash table. In order to get the hash table key to work properly I cast the number as a string and the hash table value is the same number cast as a [CHAR]. Now we can begin breaking the string apart and \"translating\" it.<\/p>\n<pre class=\"lang:ps decode:true\">$text.ToCharArray() | foreach {\r\n#because $_ will change, save the current piped in character as a variable\r\n$ltr=$_<\/pre>\n<p>The script splits the string into a character array using the default delimiter of a space. Because I'm going to be using a pipelined expression, I save the current letter as a variable. It will keep things straight in a moment.<\/p>\n<p>The next step is to find the character in the hash table values. I found the best way to accomplish this was to call the hash table's GetEnumerator() method. This way I can pipe it to Where-Object and find the corresponding key.<\/p>\n<pre class=\"lang:ps decode:true\">[int]$i=($map.getEnumerator() | where {$_.value -ceq $ltr }).Name\r\n#add the value to the array\r\n$values+=$i<\/pre>\n<p>N<span style=\"line-height: 1.714285714; font-size: 1rem;\">otice I'm using the case sensitive -ceq operator. The Name property of the hash table enumerator is the key value, or in other words the corresponding [CHAR] integer. With me still? This value is added to an array for the final result. In fact the default is\u00a0<\/span>to simply write $values to the pipeline. But, I've included a -Scriptblock parameter to have the script write a scriptblock to the pipeline using the -Join operator I mentioned earlier. Now for the interesting part.<\/p>\n<p>I have an array variable which needs to be expanded into the scriptblock. This won't work:<\/p>\n<pre class=\"lang:ps decode:true\">$sb={-join [char[]]($values)}\r\nwrite $sb<\/pre>\n<p>I'll end up with a scriptblock but have no way of resolving $values once the script ends. So instead I create a string with $values knowing that PowerShell will expand it. And because I want the array to be expanded as a comma separated string, I'll specify the $ofs variable as a comma. The default is a space.<\/p>\n<pre class=\"lang:ps decode:true\">$ofs=\",\"\r\n#create a variable so we get variable expansion of $values\r\n$t=\"-join [char[]]($values)\"<\/pre>\n<p>The variable $t is now a string with all of the integer values from $values as a comma separated list. I can turn this into scriptblock like this:<\/p>\n<pre class=\"lang:ps decode:true\">#put it back together as a script block and write to the pipeline\r\n[scriptblock]::Create($t)<\/pre>\n<p>The scriptblock gets written to the pipeline. So, I could run the script like this:<\/p>\n<pre class=\"lang:batch decode:true\">PS C:\\scripts&gt; $a=.\\Translate-ToChar.ps1\r\nPS C:\\scripts&gt; $a\r\n80\r\n111\r\n119\r\n101\r\n114\r\n83\r\n104\r\n101\r\n108\r\n108\r\n0\r\n82\r\n111\r\n99\r\n107\r\n115\r\n33<\/pre>\n<p>Now I can use $a however I want. Or I could create a scriptblock.<\/p>\n<pre class=\"lang:batch decode:true\">PS C:\\scripts&gt; $b=.\\Translate-ToChar.ps1 -Scriptblock\r\nPS C:\\scripts&gt; $b\r\n-join [char[]](80,111,119,101,114,83,104,101,108,108,0,82,111,99,107,115,33)<\/pre>\n<p>I can invoke $b anytime I want to see the message.<\/p>\n<p>While I don't expect you to be running this in production I hope you picked up some tips on using hash tables, arrays, scriptblocks and casting variable types.<\/p>\n<p>Download <a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/09\/Translate-ToChar.txt\" target=\"_blank\">Translate-ToChar<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last week I posted a PowerShell snippet on Twitter. My original post piped an array of integers as [CHAR] type using an OFS. Don&#8217;t worry about that. As many people reminded me, it is much easier to use the -Join operator. -join [char[]](116,103,105,102) I&#8217;ll let you try that on your own. The [CHAR] type is&#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,8],"tags":[145,230,199,534,82],"class_list":["post-1660","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell","category-scripting","tag-array","tag-fridayfun","tag-hashtable","tag-powershell","tag-scriptblock"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun What a CHAR! &#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\/1660\/friday-fun-what-a-char\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun What a CHAR! &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Last week I posted a PowerShell snippet on Twitter. My original post piped an array of integers as [CHAR] type using an OFS. Don&#039;t worry about that. As many people reminded me, it is much easier to use the -Join operator. -join [char[]](116,103,105,102) I&#039;ll let you try that on your own. The [CHAR] type is...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/1660\/friday-fun-what-a-char\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-09-23T14:00:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-09-13T12:37:20+00:00\" \/>\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\\\/1660\\\/friday-fun-what-a-char\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1660\\\/friday-fun-what-a-char\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun What a CHAR!\",\"datePublished\":\"2011-09-23T14:00:30+00:00\",\"dateModified\":\"2013-09-13T12:37:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1660\\\/friday-fun-what-a-char\\\/\"},\"wordCount\":574,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Array\",\"FridayFun\",\"hashtable\",\"PowerShell\",\"ScriptBlock\"],\"articleSection\":[\"Friday Fun\",\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1660\\\/friday-fun-what-a-char\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1660\\\/friday-fun-what-a-char\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1660\\\/friday-fun-what-a-char\\\/\",\"name\":\"Friday Fun What a CHAR! &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2011-09-23T14:00:30+00:00\",\"dateModified\":\"2013-09-13T12:37:20+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1660\\\/friday-fun-what-a-char\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1660\\\/friday-fun-what-a-char\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1660\\\/friday-fun-what-a-char\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun What a CHAR!\"}]},{\"@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 What a CHAR! &#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\/1660\/friday-fun-what-a-char\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun What a CHAR! &#8226; The Lonely Administrator","og_description":"Last week I posted a PowerShell snippet on Twitter. My original post piped an array of integers as [CHAR] type using an OFS. Don't worry about that. As many people reminded me, it is much easier to use the -Join operator. -join [char[]](116,103,105,102) I'll let you try that on your own. The [CHAR] type is...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1660\/friday-fun-what-a-char\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-09-23T14:00:30+00:00","article_modified_time":"2013-09-13T12:37:20+00:00","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\/1660\/friday-fun-what-a-char\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1660\/friday-fun-what-a-char\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun What a CHAR!","datePublished":"2011-09-23T14:00:30+00:00","dateModified":"2013-09-13T12:37:20+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1660\/friday-fun-what-a-char\/"},"wordCount":574,"commentCount":3,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Array","FridayFun","hashtable","PowerShell","ScriptBlock"],"articleSection":["Friday Fun","PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1660\/friday-fun-what-a-char\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1660\/friday-fun-what-a-char\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1660\/friday-fun-what-a-char\/","name":"Friday Fun What a CHAR! &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2011-09-23T14:00:30+00:00","dateModified":"2013-09-13T12:37:20+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1660\/friday-fun-what-a-char\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1660\/friday-fun-what-a-char\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1660\/friday-fun-what-a-char\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun What a CHAR!"}]},{"@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":2450,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2450\/friday-fun-powershell-crypto\/","url_meta":{"origin":1660,"position":0},"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":7489,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7489\/powershell-word-play\/","url_meta":{"origin":1660,"position":1},"title":"PowerShell Word Play","author":"Jeffery Hicks","date":"May 19, 2020","format":false,"excerpt":"A few weeks ago an Iron Scripter PowerShell challenge was issued that involved playing with words and characters. Remember, the Iron Scripter challenges aren't intended to create meaningful, production worthy code. They are designed to help you learn PowerShell fundamentals and scripting techniques. This particular challenge was aimed at beginner\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/doublechar.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/doublechar.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/doublechar.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/doublechar.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/doublechar.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/doublechar.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":7956,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7956\/friday-fun-a-powershell-christmas-prompt\/","url_meta":{"origin":1660,"position":2},"title":"Friday Fun &#8211; A PowerShell Christmas Prompt","author":"Jeffery Hicks","date":"December 11, 2020","format":false,"excerpt":"Time for a new Friday Fun article. These articles use \"fun\" ways to teach you how to use PowerShell. The end goal may be silly, but hopefully the techniques and concepts are useful. Today I have an updated prompt function. You can customize your PowerShell prompt by creating a function\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\/2020\/12\/christmas-countdown.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/12\/christmas-countdown.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":2081,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2081\/friday-fun-powershell-valentines-day\/","url_meta":{"origin":1660,"position":3},"title":"Friday Fun PowerShell Valentines Day","author":"Jeffery Hicks","date":"February 10, 2012","format":false,"excerpt":"With Valentine's Day just around the corner, I thought I should help you out with your gift giving. Remember those bags of candy with the cute sayings like \"Be Mine\"? Here's how you can create a \"bag\" of them using Windows PowerShell; perfect for that extra geeky significant other. Or\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\/02\/valentines-300x104.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":7774,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7774\/easy-powershell-custom-formatting\/","url_meta":{"origin":1660,"position":4},"title":"Easy PowerShell Custom Formatting","author":"Jeffery Hicks","date":"October 15, 2020","format":false,"excerpt":"One of the features I truly enjoy about PowerShell, is the ability to have it present information that I need in a form that I want. Here's a good example. Running Get-Process is simple enough and the output is pretty complete. But one thing that would make it better for\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/10\/get-process-ansi.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/10\/get-process-ansi.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/10\/get-process-ansi.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/10\/get-process-ansi.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/10\/get-process-ansi.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":7786,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/7786\/open-up-wide-with-powershell\/","url_meta":{"origin":1660,"position":5},"title":"Open Up Wide with PowerShell","author":"Jeffery Hicks","date":"October 19, 2020","format":false,"excerpt":"A few weeks ago, an Iron Scripter PowerShell scripting challenge was posted. The challenge involved wide directory listings. Which always makes me think \"open wide\", which leads me to \"Open Up Wide\" by Chase. (I used to play trumpet and Chase was THE band back in the day). Anyway, solving\u2026","rel":"","context":"In &quot;Scripting&quot;","block_context":{"text":"Scripting","link":"https:\/\/jdhitsolutions.com\/blog\/category\/scripting\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/10\/sw-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/10\/sw-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/10\/sw-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/10\/sw-1.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/10\/sw-1.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/10\/sw-1.png?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1660","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=1660"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1660\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}