{"id":4661,"date":"2015-12-11T10:54:17","date_gmt":"2015-12-11T15:54:17","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=4661"},"modified":"2015-12-10T08:15:02","modified_gmt":"2015-12-10T13:15:02","slug":"friday-fun-learning-from-spam","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4661\/friday-fun-learning-from-spam\/","title":{"rendered":"Friday Fun Learning from Spam"},"content":{"rendered":"<p>Today's article is definitely on the amusing side, although hopefully it will make for an interesting learning opportunity. Earlier this week I was clearing out spam on my blog and found a comment that looked like the spammer's template file. The comment contained a number of short entries like this:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/121015_0054_FridayFunLe1.png\" alt=\"Sample spam template\" \/><span style=\"color: #44546a; font-size: 9pt;\"><em>Sample spam template (Image Credit: Jeff Hicks)<\/em><\/span><\/p>\n<p>The poor English aside, I thought it was kind of funny. First off, it is clear that whatever code he (making an assumption, sorry) was using failed to properly run. Then I thought that I could use this text and do the same thing in PowerShell. It is pretty clear to me that to create a proper spam comment, I need to select a choice from each option enclosed in curly braces. So let's do that. Let's build some spam with PowerShell. I'll use the text file from above.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$file = \"C:\\scripts\\Spam3.txt\"\r\n$in = Get-Content -Path $file\r\n<\/pre>\n<p>The trickiest part, at least for me, was coming up with a regular expression pattern to select everything in the curly braces. Eventually I came up with this:<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">[regex]$rx = \"\\{(\\w+(\\S+|\\s+))+\\}\"\r\n<\/pre>\n<p>To start with, I'll test with a single line of text.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$m = $rx.matches($in[2])\r\n<\/pre>\n<p>Which gives me these matches:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/121015_0054_FridayFunLe2.png\" alt=\"My spam matches\" \/><span style=\"color: #44546a; font-size: 9pt;\"><em><br \/>\nMy spam matches (Image Credit: Jeff Hicks)<\/em><\/span><\/p>\n<p>I'll focus on the first match. I don't need the {} characters so I can replace them with empty strings and then split what remains on the | character.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$choices = $m[0].value.Replace(\"{\",\"\").Replace(\"}\",\"\") -split \"\\|\"\r\n<\/pre>\n<p>This gives me an array of choices which I can select with Get-Random.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$choice = $choices | get-random\r\n<\/pre>\n<p>With this, I can use the replace method to replace the matching value that is, the text with the curly braces, with my randomly selected choice.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$in[2].Replace($m[0].value,$choice)\r\n<\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/121015_0054_FridayFunLe3.png\" alt=\"Inserting the replacement\" \/><span style=\"color: #44546a; font-size: 9pt;\"><em>Inserting the replacement (Image Credit: Jeff Hicks)<\/em><\/span><\/p>\n<p>I can repeat this process for the other values. Here's how I might do this for a single line:<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$line = $in[2]\r\nforeach ($item in $m) {\r\n  $choices = $item.value.Replace(\"{\",\"\").Replace(\"}\",\"\") -split \"\\|\"\r\n  $choice = $choices | get-random\r\n  $line = $line.Replace($item.value,$choice)\r\n}\r\n\r\n$line\r\n<\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/121015_0054_FridayFunLe4.png\" alt=\"The complete line\" \/><span style=\"color: #44546a; font-size: 9pt;\"><em><br \/>\nThe complete line (Image Credit: Jeff Hicks)<\/em><\/span><\/p>\n<p>I never promised elegant poetry.<\/p>\n<p>Now that I have the technique, I can apply it to the entire file looping through each line.<\/p>\n<pre class=\"lang:ps mark:0 decode:true \">$spam = Foreach ($line in $in) {\r\n  $m = $rx.matches($line)\r\n  if ($m) {\r\n    foreach ($item in $m) {\r\n     $choices = $item.value.Replace(\"{\",\"\").Replace(\"}\",\"\") -split \"\\|\"\r\n     $choice = $choices | get-random\r\n     $line = $line.Replace($item.value,$choice)\r\n  }\r\n }\r\n #write the result\r\n $line\r\n}\r\n<\/pre>\n<p>And here is the glorious, delicious spammy result:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/121015_0054_FridayFunLe5.png\" alt=\"PowerShell generated spam!\" \/><span style=\"color: #44546a; font-size: 9pt;\"><em>PowerShell generated spam! (Image Credit: Jeff Hicks)<\/em><\/span><\/p>\n<p>Yes, this is absolutely silly and borderline ridiculous. But this serves as a nice tool for learning about regular expressions, replacements and splitting. If you want some spam samples to play with you can download a zip file <a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/SpamTemplates.zip\">here<\/a>.<\/p>\n<p>Have a great weekend.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today&#8217;s article is definitely on the amusing side, although hopefully it will make for an interesting learning opportunity. Earlier this week I was clearing out spam on my blog and found a comment that looked like the spammer&#8217;s template file. The comment contained a number of short entries like this: Sample spam template (Image Credit:&#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 from the blog: Friday Fun Learning #PowerShell from Spam","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,502,540],"class_list":["post-4661","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell","tag-friday-fun","tag-powershell","tag-regular-expression","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 Learning from Spam &#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\/4661\/friday-fun-learning-from-spam\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun Learning from Spam &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Today&#039;s article is definitely on the amusing side, although hopefully it will make for an interesting learning opportunity. Earlier this week I was clearing out spam on my blog and found a comment that looked like the spammer&#039;s template file. The comment contained a number of short entries like this: Sample spam template (Image Credit:...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/4661\/friday-fun-learning-from-spam\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-11T15:54:17+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/121015_0054_FridayFunLe1.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\\\/4661\\\/friday-fun-learning-from-spam\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4661\\\/friday-fun-learning-from-spam\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun Learning from Spam\",\"datePublished\":\"2015-12-11T15:54:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4661\\\/friday-fun-learning-from-spam\\\/\"},\"wordCount\":391,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4661\\\/friday-fun-learning-from-spam\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/12\\\/121015_0054_FridayFunLe1.png\",\"keywords\":[\"Friday Fun\",\"PowerShell\",\"Regular Expression\",\"Scripting\"],\"articleSection\":[\"Friday Fun\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4661\\\/friday-fun-learning-from-spam\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4661\\\/friday-fun-learning-from-spam\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4661\\\/friday-fun-learning-from-spam\\\/\",\"name\":\"Friday Fun Learning from Spam &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4661\\\/friday-fun-learning-from-spam\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4661\\\/friday-fun-learning-from-spam\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/12\\\/121015_0054_FridayFunLe1.png\",\"datePublished\":\"2015-12-11T15:54:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4661\\\/friday-fun-learning-from-spam\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4661\\\/friday-fun-learning-from-spam\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4661\\\/friday-fun-learning-from-spam\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/12\\\/121015_0054_FridayFunLe1.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/12\\\/121015_0054_FridayFunLe1.png\",\"width\":883,\"height\":177},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4661\\\/friday-fun-learning-from-spam\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun Learning from Spam\"}]},{\"@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 Learning from Spam &#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\/4661\/friday-fun-learning-from-spam\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun Learning from Spam &#8226; The Lonely Administrator","og_description":"Today's article is definitely on the amusing side, although hopefully it will make for an interesting learning opportunity. Earlier this week I was clearing out spam on my blog and found a comment that looked like the spammer's template file. The comment contained a number of short entries like this: Sample spam template (Image Credit:...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4661\/friday-fun-learning-from-spam\/","og_site_name":"The Lonely Administrator","article_published_time":"2015-12-11T15:54:17+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/121015_0054_FridayFunLe1.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\/4661\/friday-fun-learning-from-spam\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4661\/friday-fun-learning-from-spam\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun Learning from Spam","datePublished":"2015-12-11T15:54:17+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4661\/friday-fun-learning-from-spam\/"},"wordCount":391,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4661\/friday-fun-learning-from-spam\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/121015_0054_FridayFunLe1.png","keywords":["Friday Fun","PowerShell","Regular Expression","Scripting"],"articleSection":["Friday Fun","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4661\/friday-fun-learning-from-spam\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4661\/friday-fun-learning-from-spam\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4661\/friday-fun-learning-from-spam\/","name":"Friday Fun Learning from Spam &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4661\/friday-fun-learning-from-spam\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4661\/friday-fun-learning-from-spam\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/121015_0054_FridayFunLe1.png","datePublished":"2015-12-11T15:54:17+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4661\/friday-fun-learning-from-spam\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4661\/friday-fun-learning-from-spam\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4661\/friday-fun-learning-from-spam\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/121015_0054_FridayFunLe1.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/12\/121015_0054_FridayFunLe1.png","width":883,"height":177},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4661\/friday-fun-learning-from-spam\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun Learning from Spam"}]},{"@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":5154,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-ise\/5154\/friday-fun-well-thats-a-fine-todo\/","url_meta":{"origin":4661,"position":0},"title":"Friday Fun: Well That&#8217;s a Fine ToDo!","author":"Jeffery Hicks","date":"July 1, 2016","format":false,"excerpt":"Today's Friday Fun isn't exactly groundbreaking but you might find it useful in your PowerShell script development process. You might even learn a little something about the PowerShell ISE which is really the point of these articles anyway. How many times have you been working on a script or PowerShell\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"Insert a PowerShell ISE Snippet","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/07\/image_thumb.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/07\/image_thumb.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/07\/image_thumb.png?resize=525%2C300 1.5x"},"classes":[]},{"id":7134,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7134\/friday-fun-thank-god-its-a-powershell-friday\/","url_meta":{"origin":4661,"position":1},"title":"Friday Fun: Thank God It&#8217;s a PowerShell Friday","author":"Jeffery Hicks","date":"December 27, 2019","format":false,"excerpt":"Well here we are at the last Friday of the year. In fact , the last Friday of the decade! On this auspicious occasion, let's have some PowerShell fun and celebrate Friday. No matter what you call it, I'm assuming Friday is your last typical workday and something we look\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\/2019\/12\/image_thumb-38.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-38.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-38.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/image_thumb-38.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":3912,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3912\/friday-fun-a-random-powershell-console\/","url_meta":{"origin":4661,"position":2},"title":"Friday Fun: A Random PowerShell Console","author":"Jeffery Hicks","date":"July 11, 2014","format":false,"excerpt":"This week I thought we'd have a little fun with the PowerShell console and maybe pick up a few scripting techniques along the way. Today I have a function that changes the foreground and background colors of your PowerShell console to random values. But because you might want to go\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"crayons","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/crayons-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":6348,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6348\/building-more-powershell-functions\/","url_meta":{"origin":4661,"position":3},"title":"Building More PowerShell Functions","author":"Jeffery Hicks","date":"January 3, 2019","format":false,"excerpt":"In a recent post I discussed the the process you might go through in developing a PowerShell function. By the end, I not only had a new tool for my PowerShell toolbox, but I had a function outline that I could re-use. If you read the previous article then you\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\/2019\/01\/image_thumb-3.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-3.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-3.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-3.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":3804,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3804\/friday-fun-send-a-colorful-message\/","url_meta":{"origin":4661,"position":4},"title":"Friday Fun Send a Colorful Message","author":"Jeffery Hicks","date":"April 18, 2014","format":false,"excerpt":"Next week is Pluralsight's 10th anniversary. In preparing for that happy event, I wanted to send a special greeting. Of course, because my courses are on PowerShell it only seemed appropriate to use PowerShell to display my message. In fact, let's jump right to the result. Here's how I did\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"HappyBirthdayPluralsight","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/04\/HappyBirthdayPluralsight-1024x355.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":6439,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6439\/friday-fun-with-a-cross-platform-powershell-prompt\/","url_meta":{"origin":4661,"position":5},"title":"Friday Fun with a Cross-Platform PowerShell Prompt","author":"Jeffery Hicks","date":"January 18, 2019","format":false,"excerpt":"This year is turning out to be all things cross-platform for me. Continuing this line of discussion I have something fun and simple today. A PowerShell prompt function that will work cross-platform and provide some meaningful information in what I think is a elegant manner. You may not need the\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\/2019\/01\/image_thumb-20.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-20.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-20.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-20.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4661","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=4661"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4661\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=4661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=4661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=4661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}