{"id":8236,"date":"2021-03-22T10:10:26","date_gmt":"2021-03-22T14:10:26","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=8236"},"modified":"2021-03-22T10:10:35","modified_gmt":"2021-03-22T14:10:35","slug":"solving-another-powershell-math-challenge","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/","title":{"rendered":"Solving Another PowerShell Math Challenge"},"content":{"rendered":"\n<p>Last month, the Iron Scripter Chairman posted a \"fun\" PowerShell scripting challenge. Actually, a few <a href=\"https:\/\/ironscripter.us\/another-powershell-math-challenge\/\" target=\"_blank\" rel=\"noreferrer noopener\">math-related challenges <\/a>. As with all these challenges, the techniques and concepts you use to solve the challenge are more important than the result itself. Here's how I approached the problems.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Problem #1<\/h2>\n\n\n\n<p>The first challenge was to take a number, like 2568, and get the sum total of the individual integers.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">2+5+6+8<\/code><\/pre>\n\n\n\n<p>The answer being 21. You can probably think of a few ways to split the string into individual elements. I decided to use regular expressions.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">[int]$i\u00a0=\u00a012931\n\n<em>#define\u00a0a\u00a0regex\u00a0pattern\u00a0to\u00a0match\u00a0a\u00a0single\u00a0digit<\/em>\n[regex]$rx=\"\\d{1}\"<\/code><\/pre>\n\n\n\n<p>Each regular expression match object value will be the individual number. I can easily pipe the values to Measure-Object to get the sum.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\"><em>#get\u00a0all\u00a0matches\u00a0and\u00a0add\u00a0them\u00a0up<\/em>\n$measure\u00a0=\u00a0$rx.Matches($i)\u00a0|\u00a0Measure-Object\u00a0-Property\u00a0Value\u00a0-Sum\n\n<em>#write\u00a0the\u00a0sum\u00a0to\u00a0the\u00a0pipeline<\/em>\n$measure.sum<\/code><\/pre>\n\n\n\n<p>This is easy enough to turn into a function.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">Function\u00a0Get-NumberSum\u00a0{\n\n\u00a0\u00a0\u00a0\u00a0[cmdletbinding()]\n\u00a0\u00a0\u00a0\u00a0[OutputType([Int])]\n\u00a0\u00a0\u00a0\u00a0Param(\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[Parameter(Position\u00a0=\u00a00,\u00a0Mandatory,\u00a0HelpMessage\u00a0=\u00a0\"Enter\u00a0an\u00a0integer\u00a0value\u00a0like\u00a01234\")]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[Alias(\"i\")]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[int]$Value\n\u00a0\u00a0\u00a0\u00a0)\n\n\u00a0\u00a0\u00a0\u00a0<em>#define\u00a0a\u00a0regex\u00a0pattern\u00a0to\u00a0match\u00a0a\u00a0single\u00a0digit<\/em>\n\u00a0\u00a0\u00a0\u00a0[regex]$rx\u00a0=\u00a0\"\\d{1}\"\n\n\u00a0\u00a0\u00a0\u00a0<em>#get\u00a0all\u00a0matches\u00a0and\u00a0add\u00a0them\u00a0up<\/em>\n\u00a0\u00a0\u00a0\u00a0$measure\u00a0=\u00a0$rx.Matches($Value)\u00a0|\u00a0Measure-Object\u00a0-Property\u00a0Value\u00a0-Sum\n\n\u00a0\u00a0\u00a0\u00a0<em>#write\u00a0the\u00a0sum\u00a0to\u00a0the\u00a0pipeline<\/em>\n\u00a0\u00a0\u00a0\u00a0$measure.sum\n}<\/code><\/pre>\n\n\n\n<p>The function wants an integer. But the regular expression pattern works on anything with numbers in it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">($rx.matches(\"A12B9C31D\") | measure value -sum).sum<\/code><\/pre>\n\n\n\n<p>This gives me the same answer of 16.  The challenge had some bonus elements, so here is a slightly more advanced version of the function.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">Function\u00a0Get-NumberSum\u00a0{\n\u00a0\u00a0\u00a0\u00a0[cmdletbinding()]\n\u00a0\u00a0\u00a0\u00a0[OutputType([Int])]\n\u00a0\u00a0\u00a0\u00a0[OutputType(\"NumberSum\")]\n\u00a0\u00a0\u00a0\u00a0[Alias(\"gns\")]\n\u00a0\u00a0\u00a0\u00a0Param(\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[ValidateScript({\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0($_.ToString().Length\u00a0-le\u00a010)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$True\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Throw\u00a0\"Specify\u00a0a\u00a0value\u00a0of\u00a010\u00a0digits\u00a0or\u00a0less.\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$False\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0})]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[int64]$Value,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[switch]$Quiet\n\u00a0\u00a0\u00a0\u00a0)\n\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Processing\u00a0$Value\"\n\u00a0\u00a0\u00a0\u00a0<em>#define\u00a0a\u00a0regex\u00a0pattern\u00a0to\u00a0match\u00a0a\u00a0single\u00a0digit<\/em>\n\u00a0\u00a0\u00a0\u00a0[regex]$rx\u00a0=\u00a0\"\\d{1}\"\n\n\u00a0\u00a0\u00a0\u00a0$values\u00a0=\u00a0$rx.Matches($Value).Value\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0($values\u00a0-join\u00a0\"+\")\n\n\u00a0\u00a0\u00a0\u00a0$measure\u00a0=\u00a0\u00a0$Values\u00a0|\u00a0Measure-Object\u00a0-Sum\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Equals\u00a0$($measure.sum)\"\n\n\u00a0\u00a0\u00a0\u00a0if\u00a0($Quiet)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$measure.sum\n\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0else\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[pscustomobject]@{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PSTypeName\u00a0=\u00a0\"NumberSum\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Value\u00a0=\u00a0$Value\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Elements\u00a0=\u00a0$values\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Sum\u00a0=\u00a0$measure.sum\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0}\n}<\/code><\/pre>\n\n\n\n<p>This version will create a custom object by default. The -Quiet parameter shows only the result. The parameter validation could be handled in a number of ways. If I kept the type for $Value as [int], the number can't be more than 10 digits anyway. But I wanted to try something different. So I'm using a ValidateScript attribute to display a custom error message. Here's what it looks like using the function alias.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-numbersum.png\"><img loading=\"lazy\" decoding=\"async\" width=\"971\" height=\"482\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-numbersum.png\" alt=\"\" class=\"wp-image-8237\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-numbersum.png 971w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-numbersum-300x149.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-numbersum-768x381.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-numbersum-850x422.png 850w\" sizes=\"auto, (max-width: 971px) 100vw, 971px\" \/><\/a><\/figure>\n\n\n\n<p>Ok, I'll admit using a regular expression is a little overkill for this challenge, but it is fun. Here's an even simpler way.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">($i -split \"\" | measure-object -sum).sum<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Problem #2<\/h2>\n\n\n\n<p>The second problem was a bit more challenging. Given an array of numbers, what are all the possible unique sums.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"><em>$a\u00a0=\u00a02,5,6<\/em>\n\n<em>2<\/em>\n<em>5<\/em>\n<em>6<\/em>\n<em>2+5\u00a0=\u00a07<\/em>\n<em>2+5+6\u00a0=\u00a013<\/em>\n<em>2+6\u00a0=\u00a08<\/em>\n<em>5+6\u00a0=\u00a011<\/em><\/code><\/pre>\n\n\n\n<p>This problem requires getting the sum of numbers from the array, and taking all possible combinations into account. The trick is to recursively call the function, reducing the numbers to test in combination.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">function\u00a0Get-ReductiveSum\u00a0{\n\u00a0\u00a0\u00a0\u00a0param([array]$Numbers,[int]$Index=0,[int]$Sum=0)\n\n\u00a0\u00a0\u00a0\u00a0if\u00a0($numbers.count\u00a0-eq\u00a0$index)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$sum\n\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0else\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Get-ReductiveSum\u00a0$numbers\u00a0-index\u00a0($index+1)\u00a0-sum\u00a0($sum+$numbers[$index])\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Get-ReductiveSum\u00a0$numbers\u00a0($index+1)\u00a0$sum\n\u00a0\u00a0\u00a0\u00a0}\n}<\/code><\/pre>\n\n\n\n<p>I can use the function like this.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-reductivesum.png\"><img loading=\"lazy\" decoding=\"async\" width=\"908\" height=\"189\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-reductivesum.png\" alt=\"\" class=\"wp-image-8238\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-reductivesum.png 908w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-reductivesum-300x62.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-reductivesum-768x160.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-reductivesum-850x177.png 850w\" sizes=\"auto, (max-width: 908px) 100vw, 908px\" \/><\/a><\/figure>\n\n\n\n<p>To meet the challenge objectives and make this easy to use, I created this \"parent\" function.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">Function\u00a0Get-PossibleSum\u00a0{\n\u00a0\u00a0\u00a0\u00a0[cmdletbinding()]\n\u00a0\u00a0\u00a0\u00a0Param(\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[Parameter(Position\u00a0=\u00a00,\u00a0Mandatory)]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[ValidateRange(1,9)]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[int[]]$Values\n\u00a0\u00a0\u00a0\u00a0)\n\n\u00a0\u00a0\u00a0\u00a0<em>#nested\u00a0function<\/em>\n\u00a0\u00a0\u00a0\u00a0function\u00a0Get-ReductiveSum\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0param([array]$Numbers,[int]$Index=0,[int]$Sum=0)\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Get-ReductiveSum\u00a0-Numbers\u00a0$($numbers\u00a0-join\u00a0',')\u00a0-index\u00a0$index\u00a0-sum\u00a0$sum\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0($numbers.count\u00a0-eq\u00a0$index)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Found\u00a0sum\u00a0$sum\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$sum\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Reducing\u00a0numbers\u00a0to\u00a0$($numbers\u00a0-join\u00a0',')\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Setting\u00a0index\u00a0to\u00a0$($index+1)\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Get-ReductiveSum\u00a0$($sum+$numbers[$index])\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Get-ReductiveSum\u00a0$numbers\u00a0-index\u00a0($index+1)\u00a0-sum\u00a0($sum+$numbers[$index])\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Get-ReductiveSum\u00a0$sum\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Get-ReductiveSum\u00a0$numbers\u00a0($index+1)\u00a0$sum\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0}\n\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Using\u00a0values\u00a0$($values\u00a0-join\u00a0',')\"\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Verifying\u00a0unique\u00a0values\"\n\u00a0\u00a0\u00a0\u00a0$values\u00a0=\u00a0$values\u00a0|\u00a0Get-Unique\n\u00a0\u00a0\u00a0\u00a0if\u00a0($values.count\u00a0-gt\u00a09)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<em>#this\u00a0should\u00a0probably\u00a0never\u00a0happen<\/em>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Warning\u00a0\"You\u00a0specified\u00a0$($values.count)\u00a0values.\u00a0Only\u00a0using\u00a0the\u00a0first\u00a09\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$Values\u00a0=\u00a0$Values[0..8]\n\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Calculating\u00a0possible\u00a0unique\u00a0sums\u00a0for\u00a0$($values\u00a0-join\u00a0',')\"\n\u00a0\u00a0\u00a0\u00a0$result\u00a0\u00a0=\u00a0\u00a0Get-ReductiveSum\u00a0$Values\u00a0|\u00a0Where-Object\u00a0{$_\u00a0-gt\u00a00}\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Found\u00a0$($result.count)\u00a0non-zero\u00a0sums\"\n\u00a0\u00a0\u00a0\u00a0$result\u00a0|\u00a0Sort-Object\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-possiblesum.png\"><img loading=\"lazy\" decoding=\"async\" width=\"685\" height=\"390\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-possiblesum.png\" alt=\"\" class=\"wp-image-8239\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-possiblesum.png 685w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-possiblesum-300x171.png 300w\" sizes=\"auto, (max-width: 685px) 100vw, 685px\" \/><\/a><\/figure>\n\n\n\n<p>I'll let you try the code to see the Verbose output.<\/p>\n\n\n\n<p>Getting your brain to think the PowerShell way can be tough. That's why these challenges are so helpful. The more you can follow the PowerShell pipeline in your head, the easier it will be for you to use.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last month, the Iron Scripter Chairman posted a &#8220;fun&#8221; PowerShell scripting challenge. Actually, a few math-related challenges . As with all these challenges, the techniques and concepts you use to solve the challenge are more important than the result itself. Here&#8217;s how I approached the problems. Problem #1 The first challenge was to take a&#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: Solving Another #PowerShell Math Challenge from the Iron Scripter Chairman","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,8],"tags":[224,618,534,540],"class_list":["post-8236","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-function","tag-iron-scripter","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>Solving Another PowerShell Math Challenge &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"My solutions for a set of Iron Scripter PowerShell scripting challenges with a math focus. The math is simple. The PowerShell, maybe not.\" \/>\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\/8236\/solving-another-powershell-math-challenge\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Solving Another PowerShell Math Challenge &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"My solutions for a set of Iron Scripter PowerShell scripting challenges with a math focus. The math is simple. The PowerShell, maybe not.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-22T14:10:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-03-22T14:10:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-numbersum.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=\"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\\\/8236\\\/solving-another-powershell-math-challenge\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8236\\\/solving-another-powershell-math-challenge\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Solving Another PowerShell Math Challenge\",\"datePublished\":\"2021-03-22T14:10:26+00:00\",\"dateModified\":\"2021-03-22T14:10:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8236\\\/solving-another-powershell-math-challenge\\\/\"},\"wordCount\":395,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8236\\\/solving-another-powershell-math-challenge\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/get-numbersum.png\",\"keywords\":[\"Function\",\"Iron Scripter\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8236\\\/solving-another-powershell-math-challenge\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8236\\\/solving-another-powershell-math-challenge\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8236\\\/solving-another-powershell-math-challenge\\\/\",\"name\":\"Solving Another PowerShell Math Challenge &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8236\\\/solving-another-powershell-math-challenge\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8236\\\/solving-another-powershell-math-challenge\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/get-numbersum.png\",\"datePublished\":\"2021-03-22T14:10:26+00:00\",\"dateModified\":\"2021-03-22T14:10:35+00:00\",\"description\":\"My solutions for a set of Iron Scripter PowerShell scripting challenges with a math focus. The math is simple. The PowerShell, maybe not.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8236\\\/solving-another-powershell-math-challenge\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8236\\\/solving-another-powershell-math-challenge\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8236\\\/solving-another-powershell-math-challenge\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/get-numbersum.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/get-numbersum.png\",\"width\":971,\"height\":482},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8236\\\/solving-another-powershell-math-challenge\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Solving Another PowerShell Math Challenge\"}]},{\"@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":"Solving Another PowerShell Math Challenge &#8226; The Lonely Administrator","description":"My solutions for a set of Iron Scripter PowerShell scripting challenges with a math focus. The math is simple. The PowerShell, maybe not.","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\/8236\/solving-another-powershell-math-challenge\/","og_locale":"en_US","og_type":"article","og_title":"Solving Another PowerShell Math Challenge &#8226; The Lonely Administrator","og_description":"My solutions for a set of Iron Scripter PowerShell scripting challenges with a math focus. The math is simple. The PowerShell, maybe not.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/","og_site_name":"The Lonely Administrator","article_published_time":"2021-03-22T14:10:26+00:00","article_modified_time":"2021-03-22T14:10:35+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-numbersum.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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Solving Another PowerShell Math Challenge","datePublished":"2021-03-22T14:10:26+00:00","dateModified":"2021-03-22T14:10:35+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/"},"wordCount":395,"commentCount":4,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-numbersum.png","keywords":["Function","Iron Scripter","PowerShell","Scripting"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/","name":"Solving Another PowerShell Math Challenge &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-numbersum.png","datePublished":"2021-03-22T14:10:26+00:00","dateModified":"2021-03-22T14:10:35+00:00","description":"My solutions for a set of Iron Scripter PowerShell scripting challenges with a math focus. The math is simple. The PowerShell, maybe not.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-numbersum.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/get-numbersum.png","width":971,"height":482},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8236\/solving-another-powershell-math-challenge\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Solving Another PowerShell Math Challenge"}]},{"@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":8107,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8107\/scripting-challenge-meetup\/","url_meta":{"origin":8236,"position":0},"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":9018,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/9018\/an-iron-scripter-warm-up-solution\/","url_meta":{"origin":8236,"position":1},"title":"An Iron Scripter Warm-Up Solution","author":"Jeffery Hicks","date":"May 6, 2022","format":false,"excerpt":"We just wrapped up the 2022 edition of the PowerShell+DevOps Global Summit. It was terrific to be with passionate PowerShell professionals again. The culmination of the event is the Iron Scripter Challenge. You can learn more about this year's event and winner here. But there is more to the Iron\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7680,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7680\/friday-fun-back-to-school-with-powershell\/","url_meta":{"origin":8236,"position":2},"title":"Friday Fun: Back to School with PowerShell","author":"Jeffery Hicks","date":"September 11, 2020","format":false,"excerpt":"For today's fun with PowerShell, I thought I'd share my solutions for a recent Iron Scripter challenge. If you aren't familiar with these challenges, and you should be, they are designed to test your PowerShell skills and hopefully help you learn something new. There are challenges for all skill levels\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\/09\/get-cylindervolume-format.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/get-cylindervolume-format.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/get-cylindervolume-format.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/09\/get-cylindervolume-format.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":7489,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7489\/powershell-word-play\/","url_meta":{"origin":8236,"position":3},"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":7559,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7559\/an-expanded-powershell-scripting-inventory-tool\/","url_meta":{"origin":8236,"position":4},"title":"An Expanded PowerShell Scripting Inventory Tool","author":"Jeffery Hicks","date":"June 19, 2020","format":false,"excerpt":"The other day I shared my code that I worked up to solve an Iron Scripter PowerShell challenge. One of the shortcomings was that I didn't address a challenge to include a property that would indicate what file was using a given command. I also felt I could do better\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\/06\/get-psscriptinventory.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/get-psscriptinventory.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/get-psscriptinventory.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/get-psscriptinventory.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/get-psscriptinventory.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/get-psscriptinventory.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":7471,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7471\/a-powershell-network-monitor\/","url_meta":{"origin":8236,"position":5},"title":"A PowerShell Network Monitor","author":"Jeffery Hicks","date":"May 12, 2020","format":false,"excerpt":"I hope you've been trying your hand at the scripting challenges being posted on the Iron Scripter website. The challenges are designed for individuals to do on their own to build up their PowerShell scripting skills. A few weeks ago, a challenge was posted to create a network monitoring tool\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\/netperf-2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/netperf-2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/netperf-2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/netperf-2.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/netperf-2.png?resize=1050%2C600&ssl=1 3x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8236","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=8236"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8236\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=8236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=8236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=8236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}