{"id":5591,"date":"2017-06-23T13:33:58","date_gmt":"2017-06-23T17:33:58","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=5591"},"modified":"2017-06-23T13:33:58","modified_gmt":"2017-06-23T17:33:58","slug":"friday-fun-powershell-anagrams","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/","title":{"rendered":"Friday Fun: PowerShell Anagrams"},"content":{"rendered":"<p>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' and rearrange the letters to spell another word like 'opt' or 'top'.\u00a0 Short words are easy to do in your head.\u00a0 So I thought why not get PowerShell to do some of the letter crunching for me.<\/p>\n<p><!--more--><\/p>\n<p>Remember, the purpose of these articles is not the end result but the process and the techniques.\u00a0 Let's start with a word.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$w = \"angle\"\r\n<\/pre>\n<p>I know that this word should match some of the words in this list.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">#should match Angle,glean, and genal\r\n$l = \"Angle\",\"aaa\",\"glean\",\"genal\",\"angles\"\r\n<\/pre>\n<p>In an anagram, it has the same letters as the source word, just in a different order. So I figured I could turn the source word into a character array and compare the array of potential targets. I went through a number of experiments but finally settled on this.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$a = (($w.GetEnumerator() | sort) -join '')\r\n<\/pre>\n<p>In essence I've take the letters in the word, 'angle', sorted them, then rejoined into a single string, 'aegln'. If it helps, you could think of this as a type of hash. Now, I can go through each word in my potential list,\u00a0 perform the same type of hashing operation and compare.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$l | where {$a -eq (($_.GetEnumerator() | sort) -join '')}\r\n<\/pre>\n<p>If you try this you should get the expected results.\u00a0 But the whole point is to discover anagrams for a given word. And for that I need a big list of words.<\/p>\n<p>I found one at from <a href=\"https:\/\/github.com\/dwyl\/english-words\">https:\/\/github.com\/dwyl\/english-words<\/a> that has over 466K entries. I downloaded a copy to my Scripts folder. Given the size, I figured it would be easier to test my process on a subset of words.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">Get-content c:\\scripts\\dictionary.txt | select -first 50000 | \r\nwhere {($a -eq (($_.GetEnumerator() | sort) -join ''))}\r\n<\/pre>\n<p>This gave me 3 anagrams in just under 15 seconds. Then I realized, it doesn't make any sense to compare any words from the list that don't have the same number of characters.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">Get-content c:\\scripts\\dictionary.txt | select -first 50000 |  \r\nwhere { ($_.length -eq $w.length) -and ($a -eq (($_.GetEnumerator() | sort) -join ''))}\r\n<\/pre>\n<p>That took 2.5 seconds! Let's try the whole word list.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$w = \"angel\"\r\n$a = ($w.getenumerator() | sort) -join \"\"\r\nGet-content c:\\scripts\\dictionary.txt | \r\nwhere {($_.length -eq $w.length) -AND ((($_.getenumerator() | sort) -join \"\") -eq $a )}\r\n<\/pre>\n<p>That took about 21 seconds.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/06\/image.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\/06\/image_thumb.png\" alt=\"image\" width=\"644\" height=\"182\" border=\"0\" \/><\/a><\/p>\n<p>By the way, I also tested with getting the word list first and then piping that to <a title=\"Read online help for this command\" href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkID=113423\" target=\"_blank\" rel=\"noopener\">Where-Object<\/a>.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$dict = Get-content c:\\scripts\\dictionary.txt\r\n$dict | where {($_.length -eq $w.length) -AND ((($_.getenumerator() | sort) -join \"\") -eq $a )}\r\n<\/pre>\n<p>This was not any faster. It took over 9 seconds to read in the 466K words and then almost 2 minutes to filter.<\/p>\n<p>Now that I have settled on some core code, let's wrap it up in a function.<\/p>\n<p>https:\/\/gist.github.com\/jdhitsolutions\/1a05db07a3bc1b5c93728755f631b34e<\/p>\n<p>The function is a gist on my GitHub repo and defines a function called Get-Anagram. You will need a word list. I've set a default value for mine.<\/p>\n<p>Usage, is pretty simple. Specify a word and a word list. My function will write a custom object to the pipeline with a property of all the anagrams. Here are a few examples of the function in action.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/06\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"image\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/06\/image_thumb-1.png\" alt=\"image\" width=\"644\" height=\"482\" border=\"0\" \/><\/a><\/p>\n<p>Yeah, I don't expect you to have an urgent business need to find an anagram for 'danger' ('ranged' in case you were curious) but you might need to process a large log file, understand filtering or get an example of how to write a function.<\/p>\n<p>Or maybe you just want to have a little fun. Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Maybe it&#8217;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 &#8216;pot&#8217; and rearrange the letters to&#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: #PowerShell Anagrams","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":[568,534,540],"class_list":["post-5591","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell","tag-friday-fun","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: PowerShell Anagrams &#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\/5591\/friday-fun-powershell-anagrams\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun: PowerShell Anagrams &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Maybe it&#039;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 &#039;pot&#039; and rearrange the letters to...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2017-06-23T17:33:58+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/06\/image_thumb.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\\\/5591\\\/friday-fun-powershell-anagrams\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5591\\\/friday-fun-powershell-anagrams\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun: PowerShell Anagrams\",\"datePublished\":\"2017-06-23T17:33:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5591\\\/friday-fun-powershell-anagrams\\\/\"},\"wordCount\":545,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5591\\\/friday-fun-powershell-anagrams\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/image_thumb.png\",\"keywords\":[\"Friday Fun\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"Friday Fun\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5591\\\/friday-fun-powershell-anagrams\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5591\\\/friday-fun-powershell-anagrams\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5591\\\/friday-fun-powershell-anagrams\\\/\",\"name\":\"Friday Fun: PowerShell Anagrams &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5591\\\/friday-fun-powershell-anagrams\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5591\\\/friday-fun-powershell-anagrams\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/image_thumb.png\",\"datePublished\":\"2017-06-23T17:33:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5591\\\/friday-fun-powershell-anagrams\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5591\\\/friday-fun-powershell-anagrams\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5591\\\/friday-fun-powershell-anagrams\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/image_thumb.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/image_thumb.png\",\"width\":644,\"height\":182},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/5591\\\/friday-fun-powershell-anagrams\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun: PowerShell Anagrams\"}]},{\"@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: PowerShell Anagrams &#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\/5591\/friday-fun-powershell-anagrams\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun: PowerShell Anagrams &#8226; The Lonely Administrator","og_description":"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' and rearrange the letters to...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/","og_site_name":"The Lonely Administrator","article_published_time":"2017-06-23T17:33:58+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/06\/image_thumb.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\/5591\/friday-fun-powershell-anagrams\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun: PowerShell Anagrams","datePublished":"2017-06-23T17:33:58+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/"},"wordCount":545,"commentCount":3,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/06\/image_thumb.png","keywords":["Friday Fun","PowerShell","Scripting"],"articleSection":["Friday Fun","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/","name":"Friday Fun: PowerShell Anagrams &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/06\/image_thumb.png","datePublished":"2017-06-23T17:33:58+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/06\/image_thumb.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/06\/image_thumb.png","width":644,"height":182},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5591\/friday-fun-powershell-anagrams\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun: PowerShell Anagrams"}]},{"@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":4278,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-ise\/4278\/friday-fun-send-powershell-ise-content-to-word\/","url_meta":{"origin":5591,"position":0},"title":"Friday Fun: Send PowerShell ISE Content to Word","author":"Jeffery Hicks","date":"March 13, 2015","format":false,"excerpt":"Yesterday on Facebook, Ed Wilson was lamenting about confusion of keyboard shortcuts between PowerShell and Microsoft Word. I've run into the same issue. Muscle memory is strong. Then the discussion turned to getting content from the PowerShell ISE into a Word document. I humorously suggested we had a plugin and\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"geek","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/01\/geek.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1069,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1069\/friday-fun-out-rainbow\/","url_meta":{"origin":5591,"position":1},"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":3455,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/3455\/friday-fun-color-my-web\/","url_meta":{"origin":5591,"position":2},"title":"Friday Fun Color My Web","author":"Jeffery Hicks","date":"September 20, 2013","format":false,"excerpt":"Awhile ago I posted an article demonstrating using Invoke-Webrequest which is part of PowerShell 3.0. I used the page at Manning.com to display the Print and MEAP bestsellers. By the way, thanks to all of you who keep making PowerShell books popular. My original script simply wrote the results to\u2026","rel":"","context":"In &quot;Books&quot;","block_context":{"text":"Books","link":"https:\/\/jdhitsolutions.com\/blog\/category\/books\/"},"img":{"alt_text":"get-manningbestseller1","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/09\/get-manningbestseller1-1024x606.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/09\/get-manningbestseller1-1024x606.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/09\/get-manningbestseller1-1024x606.png?resize=525%2C300 1.5x"},"classes":[]},{"id":4407,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4407\/friday-fun-a-powershell-macro\/","url_meta":{"origin":5591,"position":3},"title":"Friday Fun: A PowerShell Macro","author":"Jeffery Hicks","date":"May 15, 2015","format":false,"excerpt":"Today's Friday Fun is a little different in that it showcases two things I use almost every day: Microsoft Word and PowerShell. I am writing new articles and material almost daily and of course very often the content is PowerShell related. Usually I use the blog post template in Word\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":8107,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8107\/scripting-challenge-meetup\/","url_meta":{"origin":5591,"position":4},"title":"Scripting Challenge Meetup","author":"Jeffery Hicks","date":"February 1, 2021","format":false,"excerpt":"As you probably know, I am the PowerShell problem master behind the challenges from the Iron Scripter site. Solving a PowerShell scripting challenge is a great way to test your skills and expand your knowledge. The final result is merely a means to an end. How you get there and\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\/2021\/02\/rubik.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2450,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2450\/friday-fun-powershell-crypto\/","url_meta":{"origin":5591,"position":5},"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":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5591","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=5591"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5591\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=5591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=5591"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=5591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}