{"id":2720,"date":"2013-01-19T11:00:33","date_gmt":"2013-01-19T16:00:33","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=2720"},"modified":"2013-01-21T08:34:30","modified_gmt":"2013-01-21T13:34:30","slug":"silly-saturday-powershell-palindromes","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2720\/silly-saturday-powershell-palindromes\/","title":{"rendered":"Silly Saturday PowerShell Palindromes"},"content":{"rendered":"<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/242px-Sator_Square_at_Opp\u00e8de.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/242px-Sator_Square_at_Opp\u00e8de-150x150.jpg\" alt=\"242px-Sator_Square_at_Opp\u00e8de\" width=\"150\" height=\"150\" class=\"alignleft size-thumbnail wp-image-2723\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/242px-Sator_Square_at_Opp\u00e8de-150x150.jpg 150w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/242px-Sator_Square_at_Opp\u00e8de.jpg 242w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/a>Normally I post amusing PowerShell-related content on Fridays as part of my Friday Fun series. These are light-hearted articles about using PowerShell. Almost always they are not practical but they serve as a learning vehicle. My topic this week seems extra silly so I'm moving it to Saturday. I'm a pushover for alliteration.<\/p>\n<p>Last week I came across a comment on Facebook that involved palindromes. A palindrome is a word that is spelled the same backwards and forwards. Names like Otto and ABBA are palindromes. So are words like madam, civic, and redder. I thought it would be fun to use PowerShell to test if a string was a palindrome. To figure this out I would need to find the midpoint of the string, get the first part of the string and then compare it to the last part of the string, but in reverse order.<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> $t = \"madam\"<br \/>\nPS C:\\> $mid=[math]::Truncate($t.length\/2)<br \/>\nPS C:\\> $mid<br \/>\n2<br \/>\n<\/code><\/p>\n<p>I'm using the Truncate method from the [Math] class so that when I divide the string length by 2, the value is rounded down. This will be important in a moment. Getting the first half of the string is pretty simple.<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> $start = -join ($t[0..($mid-1)])<br \/>\nPS C:\\> $start<br \/>\nma<br \/>\n<\/code><\/p>\n<p>I'm getting characters in $t by their index number. In this case going from 0 to the midpoint minus 1. This would give me an array of characters so I regroup them using the -join operator. As an alternative, I could also have done this:<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> $start = $t.Substring(0,($mid))<br \/>\n<\/code><\/p>\n<p>Now to get the last half. Remember, I need to get the end of the string in reverse order until I reach the midpoint again. I can use the same technique I used for the front, except this time starting at the end and going backwards.<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> $end = -join ($t[-1..-($mid)])<br \/>\nPS C:\\> $end<br \/>\nma<br \/>\n<\/code><\/p>\n<p>Now to compare $start and $end.<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> $start -eq $end<br \/>\nTrue<br \/>\n<\/code><\/p>\n<p>You may be wondering, \"What about the 'd'?\" Well, in this case it is irrelevant because going backwards or forwards the 'd' is in the same place. I think of these as pivot letters. But this technique also works for strings without a pivot point.<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> $t=\"redder\"<br \/>\nPS C:\\> $mid=[math]::Truncate($t.length\/2)<br \/>\nPS C:\\> $start = -join ($t[0..($mid-1)])<br \/>\nPS C:\\> $end = -join ($t[-1..-($mid)])<br \/>\nPS C:\\> $start -eq $end<br \/>\nTrue<br \/>\nPS C:\\> $start<br \/>\nred<br \/>\nPS C:\\> $end<br \/>\nred<br \/>\nPS C:\\><br \/>\n<\/code><\/p>\n<p>So how about a simple function to test if a string is a palindrome?<\/p>\n<p><code lang=\"PowerShell\"><br \/>\nFunction Test-IsPalindrome {<br \/>\n[cmdletbinding()]<br \/>\nParam(<br \/>\n[Parameter(Position=0,Mandatory=$True,ValueFromPipeline=$True)]<br \/>\n[ValidateNotNullorEmpty()]<br \/>\n[string]$Text,<br \/>\n[switch]$IgnoreSpace<br \/>\n)<\/p>\n<p>Process {<br \/>\n    Write-Verbose \"Testing $Text\"<br \/>\n    if ($IgnoreSpace) {<br \/>\n        Write-Verbose \"Removing spaces from text\"<br \/>\n        $text = $text.Replace(\" \",\"\")<br \/>\n        Write-Verbose $text<br \/>\n    }<br \/>\n    $l = $text.length<br \/>\n    Write-Verbose \"Length is $l\"<br \/>\n    $mid = [math]::Truncate($l\/2)<br \/>\n    Write-Verbose \"Midpoint is $mid\"<\/p>\n<p>    #could also use Substring()<br \/>\n    $start = -join ($text[0..($mid-1)]) #$text.Substring(0,($mid))<br \/>\n    $end = -join ($text[-1..-($mid)])<br \/>\n    Write-Verbose \"Start: $start\"<br \/>\n    Write-Verbose \"Pivot: $($Text[$mid])\"<br \/>\n    Write-Verbose \"End  : $end\"<br \/>\n    if ($start -eq $end) {<br \/>\n     $True<br \/>\n    }<br \/>\n    else {<br \/>\n     $false<br \/>\n    }<\/p>\n<p>} #process<br \/>\n} #end Test-IsPalindrome<br \/>\n<\/code><\/p>\n<p>This is an advanced function so I could add some verbose messages, which is great for troubleshooting and debugging. I also wanted to be able to pipe strings to the function. The intent is to test a string and return True or False. The code is essentially the same thing I showed you, except now it is a little easier to use. <\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> \"redder\",\"foo\",\"civic\",\"madam\" | Test-IsPalindrome <\/p>\n<p>True<br \/>\nFalse<br \/>\nTrue<br \/>\nTrue<br \/>\n<\/code><\/p>\n<p>I added an extra feature to strip out spaces.<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> Test-IsPalindrome \"Madam Im Adam\" -IgnoreSpace -Verbose<br \/>\nVERBOSE: Testing Madam Im Adam<br \/>\nVERBOSE: Removing spaces from text<br \/>\nVERBOSE: MadamImAdam<br \/>\nVERBOSE: Length is 11<br \/>\nVERBOSE: Midpoint is 5<br \/>\nVERBOSE: Start: Madam<br \/>\nVERBOSE: Pivot: I<br \/>\nVERBOSE: End  : madAm<br \/>\nTrue<br \/>\nPS C:\\> Test-IsPalindrome \"A nut for a jar of tuna\" -IgnoreSpace<br \/>\nTrue<br \/>\n<\/code><\/p>\n<p>Yes, this is a silly application of PowerShell. But I hope it gives you an idea of how to use the -Join operator and to work with strings. By the way, I could use these techniques to turn a string into a palindrome.<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS C:\\> $text=\"sum\"<br \/>\nPS C:\\> -join ($Text, -join $Text[-1..-($Text.length)])<br \/>\nsummus<br \/>\n<\/code><\/p>\n<p>Ok, perhaps not a valid word in English but see if you can follow what the -Join operators are doing and how this snippet works. If you'd like to play with this, you can download <a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/Test-IsPalindrome.txt\" target=\"_Blank\">Test-IsPalindrome<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Normally I post amusing PowerShell-related content on Fridays as part of my Friday Fun series. These are light-hearted articles about using PowerShell. Almost always they are not practical but they serve as a learning vehicle. My topic this week seems extra silly so I&#8217;m moving it to Saturday. I&#8217;m a pushover for alliteration. Last week&#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],"tags":[396,414,534,243],"class_list":["post-2720","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-join","tag-operators","tag-powershell","tag-string"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Silly Saturday PowerShell Palindromes &#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\/2720\/silly-saturday-powershell-palindromes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Silly Saturday PowerShell Palindromes &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Normally I post amusing PowerShell-related content on Fridays as part of my Friday Fun series. These are light-hearted articles about using PowerShell. Almost always they are not practical but they serve as a learning vehicle. My topic this week seems extra silly so I&#039;m moving it to Saturday. I&#039;m a pushover for alliteration. Last week...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/2720\/silly-saturday-powershell-palindromes\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2013-01-19T16:00:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-01-21T13:34:30+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/242px-Sator_Square_at_Opp\u00e8de-150x150.jpg\" \/>\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\\\/2720\\\/silly-saturday-powershell-palindromes\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2720\\\/silly-saturday-powershell-palindromes\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Silly Saturday PowerShell Palindromes\",\"datePublished\":\"2013-01-19T16:00:33+00:00\",\"dateModified\":\"2013-01-21T13:34:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2720\\\/silly-saturday-powershell-palindromes\\\/\"},\"wordCount\":499,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"join\",\"operators\",\"PowerShell\",\"string\"],\"articleSection\":[\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2720\\\/silly-saturday-powershell-palindromes\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2720\\\/silly-saturday-powershell-palindromes\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2720\\\/silly-saturday-powershell-palindromes\\\/\",\"name\":\"Silly Saturday PowerShell Palindromes &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2013-01-19T16:00:33+00:00\",\"dateModified\":\"2013-01-21T13:34:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2720\\\/silly-saturday-powershell-palindromes\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2720\\\/silly-saturday-powershell-palindromes\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/2720\\\/silly-saturday-powershell-palindromes\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Silly Saturday PowerShell Palindromes\"}]},{\"@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":"Silly Saturday PowerShell Palindromes &#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\/2720\/silly-saturday-powershell-palindromes\/","og_locale":"en_US","og_type":"article","og_title":"Silly Saturday PowerShell Palindromes &#8226; The Lonely Administrator","og_description":"Normally I post amusing PowerShell-related content on Fridays as part of my Friday Fun series. These are light-hearted articles about using PowerShell. Almost always they are not practical but they serve as a learning vehicle. My topic this week seems extra silly so I'm moving it to Saturday. I'm a pushover for alliteration. Last week...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2720\/silly-saturday-powershell-palindromes\/","og_site_name":"The Lonely Administrator","article_published_time":"2013-01-19T16:00:33+00:00","article_modified_time":"2013-01-21T13:34:30+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/242px-Sator_Square_at_Opp\u00e8de-150x150.jpg","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\/2720\/silly-saturday-powershell-palindromes\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2720\/silly-saturday-powershell-palindromes\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Silly Saturday PowerShell Palindromes","datePublished":"2013-01-19T16:00:33+00:00","dateModified":"2013-01-21T13:34:30+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2720\/silly-saturday-powershell-palindromes\/"},"wordCount":499,"commentCount":2,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["join","operators","PowerShell","string"],"articleSection":["PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/2720\/silly-saturday-powershell-palindromes\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2720\/silly-saturday-powershell-palindromes\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2720\/silly-saturday-powershell-palindromes\/","name":"Silly Saturday PowerShell Palindromes &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2013-01-19T16:00:33+00:00","dateModified":"2013-01-21T13:34:30+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2720\/silly-saturday-powershell-palindromes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/2720\/silly-saturday-powershell-palindromes\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2720\/silly-saturday-powershell-palindromes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Silly Saturday PowerShell Palindromes"}]},{"@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":5591,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/","url_meta":{"origin":2720,"position":0},"title":"Friday Fun: PowerShell Anagrams","author":"Jeffery Hicks","date":"June 23, 2017","format":false,"excerpt":"Maybe it's my liberal arts background but I love words and word games. I have a constant pile of crosswords and enjoy tormenting my kids (and wife) with puns.\u00a0 I am also fascinated with word hacks like palindromes and anagrams. An anagram is where you take a word like 'pot'\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/06\/image_thumb.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/06\/image_thumb.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/06\/image_thumb.png?resize=525%2C300 1.5x"},"classes":[]},{"id":3925,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3925\/friday-fun-reverse-powershell\/","url_meta":{"origin":2720,"position":1},"title":"Friday Fun Reverse PowerShell","author":"Jeffery Hicks","date":"July 18, 2014","format":false,"excerpt":"These Friday Fun posts are not supposed to be practical, yet hopefully still entertaining and educational. Today's article is no exception but I 'll be you'll try it at least once. And you'll maybe even learn something about PowerShell that perhaps you didn't know before. It all starts with a\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"reverse","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/07\/reverse.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":5512,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5512\/friday-fun-crossing-the-border-with-powershell\/","url_meta":{"origin":2720,"position":2},"title":"Friday Fun: Crossing the Border with PowerShell","author":"Jeffery Hicks","date":"March 24, 2017","format":false,"excerpt":"Today's Friday Fun post, as most of these are, is a little silly and a little educational. Because I obviously am avoiding getting any real work accomplished, I worked on a little project that would add a border around a string of text. I often write formatted text to the\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb-11.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb-11.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb-11.png?resize=525%2C300 1.5x"},"classes":[]},{"id":940,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/940\/friday-fun-playing-with-strings\/","url_meta":{"origin":2720,"position":3},"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":1389,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1389\/friday-fun-randomness-abounds\/","url_meta":{"origin":2720,"position":4},"title":"Friday Fun Randomness Abounds","author":"Jeffery Hicks","date":"April 29, 2011","format":false,"excerpt":"I find it a little ironic that although I like efficiency, structure and order I'm fascinated with randomness. In today's Friday Fun I want to explore a few ways you might incorporate randomness into your PowerShell scripting. Perhaps you need a random number between 100 and 500. Or a string\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":2098,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2098\/valentines-day-powershell-fun\/","url_meta":{"origin":2720,"position":5},"title":"Valentines Day PowerShell Fun","author":"Jeffery Hicks","date":"February 14, 2012","format":false,"excerpt":"In case you missed some of the fun on Twitter and Google Plus, here are the PowerShell valentines I sent today. These are intended to be run from the PowerShell console, not the ISE. Also, depending on your console font, you might get slightly different results. I use Lucida Console.\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\/2012\/02\/psvalentine.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2720","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=2720"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2720\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}