{"id":643,"date":"2014-09-22T00:01:00","date_gmt":"2014-09-22T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2014\/09\/22\/fun-formatting-onespart-1-the-task\/"},"modified":"2014-09-22T00:01:00","modified_gmt":"2014-09-22T00:01:00","slug":"fun-formatting-onespart-1-the-task","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/fun-formatting-onespart-1-the-task\/","title":{"rendered":"Fun Formatting Ones&#8212;Part 1: The Task"},"content":{"rendered":"<p><b style=\"font-size:12px\">Summary<\/b><span style=\"font-size:12px\">: June Blender explains Doug Finke&#039;s multiplication and formatting trick. Today&#8230;the task.<\/span><\/p>\n<p>Microsoft Scripting Guy, Ed Wilson, is here. Today, Honorary Scripting Guy, June Blender, examines a multiplication and formatting trick that Doug Finke posted on the <a href=\"https:\/\/www.facebook.com\/groups\/powershell\/\" target=\"_blank\">PowerShell Facebook page<\/a>. I&#039;ve broken this article into two parts:<\/p>\n<p><b>Part 1: The Task<\/b> &nbsp;&nbsp;Explains what Doug was trying to do and how to do it in Windows PowerShell.<\/p>\n<p><b>Part 2: The Method<\/b> &nbsp;&nbsp;Explains the techniques that Doug used.<\/p>\n<p>If you already understand <b>The Task<\/b>, you can wait for <b>Part 2:<\/b> <b>The Method<\/b>. Now, here&#039;s June&#8230;<\/p>\n<p>Windows PowerShell MVP, Doug Finke, author of <a href=\"http:\/\/shop.oreilly.com\/product\/0636920024491.do\" target=\"_blank\">Windows PowerShell for Developers<\/a>, is one of nicest and most clever people in the Windows PowerShell community. I&#039;m a big fan, because I almost always learn something really new when I read Doug&#039;s work. You can contact Doug at:<\/p>\n<ul>\n<li>Website: <a href=\"http:\/\/dougfinke.com\/\" target=\"_blank\">http:\/\/dougfinke.com<\/a><\/li>\n<li>Twitter: <a href=\"https:\/\/twitter.com\/dfinke\" target=\"_blank\">@dfinke<\/a><\/li>\n<\/ul>\n<p>Last week, Doug posted the following fun multiplication and formatting trick:<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/Doug_1.PNG\"><img decoding=\"async\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/Doug_1.PNG\" alt=\"Image of command output\" title=\"Image of command output\" \/><\/a><\/p>\n<p>Many people &quot;liked&quot; the post (including me), but I realized that not everyone understood why it worked. If you do understand it, you might be able to use the techniques for slightly less fun things, like work. Let&#039;s tease it apart and learn all that Doug has to teach. This post explains what Doug was trying to do and how to do it in Windows PowerShell.<\/p>\n<p>It looks like Doug had a bit of fun with the cool patterns of squares of numbers with 1s, and he wanted to create this table of products in Windows PowerShell.<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1 &nbsp;&nbsp;&nbsp;x 1 &nbsp;&nbsp;&nbsp;= 1<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11 &nbsp;&nbsp;x 1 &nbsp;&nbsp;&nbsp;= 11<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11 &nbsp;&nbsp;x 11 &nbsp;&nbsp;= 121<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">111 &nbsp;x 111 &nbsp;= 12321<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1111 x 1111 = 1234321<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">&hellip;<\/p>\n<p>Each row of the table multiplies <i>n<\/i> digits of 1s and shows the product. The number of 1-digits increases with each row. To do this, he creates a loop that goes from 1 to 8 and prints that number of 1s and their product. It would look like:<\/p>\n<ul>\n<li>Row 1: Print one 1. Then print the product of 1 x 1.<\/li>\n<li>Row 2: Print two 1s. Then print the product of 11 x 11.<\/li>\n<li>&hellip;<\/li>\n<li>Row 8: Print eight 1s. Then print the product of 11111111 x 11111111.<\/li>\n<\/ul>\n<p>To do this, you use a loop that starts at 1 and ends at your stopping point, which for Doug, is 8. This is a bit tricky, because you&#039;re working with strings, not numbers.<\/p>\n<p>The essential part of this task is to print a specified number of 1s (twice). To do that, you use string multiplication, so let&#039;s start with that topic.<\/p>\n<h2>Multiplying strings<\/h2>\n<p>Most scripting and programming languages have operators that add and multiply numbers, for example:<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; 3 + 4<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">7 &lt;yawn&gt;<\/p>\n<p class=\"Code\">&nbsp;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; 3 * 4<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">12 &lt;duh&gt;<\/p>\n<p>But Windows PowerShell lets you use the same <b>+<\/b> and <b>*<\/b> operators to add and multiply strings.<\/p>\n<p>When you <b>add<\/b> strings, Windows PowerShell concatenates them (no spaces):<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; &quot;Power&quot; + &quot;Shell&quot;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PowerShell<\/p>\n<p>When you <b>multiply<\/b> a string by a number <i>n<\/i>, Windows PowerShell copies the string <i>n<\/i> times and concatenates the results:<\/p>\n<p style=\"margin-left:30px\"><span style=\"font-size:12px\">PS C:\\&gt; &quot;Car&quot; * 3<\/span><\/p>\n<p style=\"margin-left:30px\"><span style=\"font-size:12px\">CarCarCar<\/span><\/p>\n<p>String multiplication isn&#039;t commutative. Because the first operand determines the operation, the string must come first in a string multiplication expression. If an integer comes first, Windows PowerShell tries to do integer multiplication, which doesn&#039;t permit strings.<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; 3 * &quot;Car&quot;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">Cannot convert value &quot;Car&quot; to type &quot;System.Int32&quot;. Error: &quot;Input string was not in a correct format.&quot;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">At line:1 char:1<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">+ 3 * &quot;Car&quot;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">+ ~~~~~~~~~<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; + CategoryInfo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : InvalidArgument: (:) [], RuntimeException<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; + FullyQualifiedErrorId : InvalidCastFromStringToInteger<\/p>\n<p class=\"Code\"><span style=\"font-size:12px\">String multiplication lets you do some cool things. This <\/span><b style=\"font-size:12px\">For<\/b><span style=\"font-size:12px\"> loops starts with <strong>$i = 1<\/strong> and counts up to <strong>$i = 5<\/strong>. In each pass, it multiplies the <strong>&quot;x&quot;<\/strong> string by the value <strong>$i<\/strong>:<\/span><\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; for ($i = 1; $i -le 5; $i++) {&quot;x&quot; * $i}<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">x<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">xx<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">xxx<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">xxxx<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">xxxxx<\/p>\n<p>This is a handy trick. In languages that don&#039;t allow string multiplication, like Python and Java, you need nested loops to do this.<\/p>\n<p>Doug has fun with the string <strong>&quot;1&quot;<\/strong>. Note that <strong>&quot;1&quot;<\/strong> is a string enclosed in quotation marks, not an integer. In Doug&#039;s statement, he multiplies the <strong>&quot;1&quot;<\/strong> string by <strong>$i<\/strong> where<strong> i<\/strong> goes from 1 to 8:<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">for ($i = 1; $i -le 8; $i++)<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">{<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">&quot;1&quot; * $i<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">}<\/p>\n<p class=\"Code\">&nbsp;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">111<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1111<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11111<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">111111<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1111111<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11111111<\/p>\n<p class=\"Code\"><span style=\"font-size:12px\">This creates the first set of 1s for Doug&#039;s display. But he needs two sets of 1s on each row, separated by an <strong>&quot; x &quot;<\/strong>. We&#039;ll use string addition to get it.<\/span><\/p>\n<h2>Adding Strings<\/h2>\n<p>To get the first part of Doug&#039;s display, we can use a loop that multiplies a number by a <strong>&quot;1&quot;<\/strong> string . But Doug&#039;s table requires two sets of 1s, separated by an <strong>&quot; x &quot;<\/strong>.<\/p>\n<p>To add the <strong>&quot; x &quot;<\/strong>, we&#039;ll use the addition operator (<b>+<\/b>). It concatenates the first set of ones, the <strong>&quot; x &quot;<\/strong> string, and the second set of ones.<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">(&quot;1&quot; * $i) <b>+<\/b> &quot; x &quot; <b>+<\/b> (&quot;1&quot; * $i)<\/p>\n<p>When<strong> $i<\/strong> is 1, it produces the first row. When <strong>$i<\/strong> is 2, it produces the second row:<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\ps-test&gt; $i = 1<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\ps-test&gt; (&quot;1&quot; * $i) + &quot; x &quot; + (&quot;1&quot; * $i)<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1 x 1<\/p>\n<p class=\"Code\">&nbsp;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\ps-test&gt; $i = 2<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\ps-test&gt; (&quot;1&quot; * $i) + &quot; x &quot; + (&quot;1&quot; * $i)<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11 x 11<\/p>\n<p class=\"Code\"><span style=\"font-size:12px\">Now, let&#039;s use a loop that starts <strong>$i<\/strong> at 1 and goes to 8 (inclusive):<\/span><\/p>\n<p class=\"Code\" style=\"margin-left:30px\">for ($i = 1; $i -le 8; $i++)<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">{<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; &quot;1&quot; * $i + &quot; x &quot; + &quot;1&quot; * $i<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">}<\/p>\n<p class=\"Code\">\n<p class=\"Code\" style=\"margin-left:30px\">1 x 1<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11 x 11<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">111 x 111<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1111 x 1111<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11111 x 11111<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">111111 x 111111<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1111111 x 1111111<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11111111 x 11111111<\/p>\n<p>Looking good!<\/p>\n<p>The next part is<strong> &quot; = &quot;<\/strong> string, so let&#039;s add it:<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">for ($i = 1; $i -le 8; $i++)<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">{<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; &quot;1&quot; * $i + &quot; x &quot; + &quot;1&quot; * $i&nbsp; + &quot; = &quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">}<\/p>\n<p>&nbsp;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1 x 1 =<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11 x 11 =<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">111 x 111 =<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1111 x 1111 =<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11111 x 11111 =<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">111111 x 111111 =<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1111111 x 1111111 =<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11111111 x 11111111 =<\/p>\n<p>The <b>&quot;1&quot; * $i<\/b> part of the equation is getting a bit repetitive (and error prone). Let&#039;s assign it to the <b>$n<\/b> variable. Then, we can replace the instances of <b>&quot;1&quot; * $i<\/b> with <b>$n<\/b>:<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">for ($i = 1; $i -le 8; $i++)<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">{<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; $n = &quot;1&quot; * $i&nbsp;&nbsp; #Assignment<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; $n + &quot; x &quot; + $n&nbsp; + &quot; = &quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">}<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1 x 1 =<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11 x 11 =<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">111 x 111 =<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1111 x 1111 =<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11111 x 11111 =<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">111111 x 111111 =<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1111111 x 1111111 =<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11111111 x 11111111 =<\/p>\n<p><span style=\"font-size:12px\">Next, Doug wants to display the product of each equation. To get the product, he needs to multiply numbers, not strings. Let&#039;s see how he does it.<\/span><\/p>\n<h2>Invoke-Expression: Convert number strings to numbers<\/h2>\n<p>Doug wants to display the products of the numbers that he&#039;s printing:<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11 * 1 = 11<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11 * 11 = 121<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">111 * 111 = 12321<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1111 * 1111 = 1234321<\/p>\n<p class=\"Code\"><span style=\"font-size:12px\">But, he was playing with strings of 1s, not the number 1. To convert the strings of numbers to numbers for the expression, he uses the <\/span><b style=\"font-size:12px\">Invoke-Expression<\/b><span style=\"font-size:12px\"> cmdlet. Let&#039;s see how this works:<\/span><\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; &quot;2 * 3&quot;&nbsp;&nbsp;&nbsp; #This is a string.<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">&quot;2 * 3&quot;<\/p>\n<p class=\"Code\">&nbsp;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; Invoke-Expression -Command &quot;2 * 3&quot;&nbsp; #This is a string.<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; 6<\/p>\n<p>Now, let&#039;s try it with &quot;1&quot; strings:<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; &quot;111 * 111&quot;&nbsp;&nbsp;&nbsp; #This is a string.<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">&quot;111 * 111&quot;<\/p>\n<p class=\"Code\">&nbsp;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; Invoke-Expression -Command &quot;111 * 111&quot;&nbsp; #Still a string.<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; 12321<\/p>\n<p>Be careful. To make this work, the value must be a single string, and all values and operators must be convertible to an arithmetic expression.<\/p>\n<p>You can also pipe the number string to the <b>Invoke-Expression<\/b> cmdlet, which is what Doug did. And he used the <b>iex<\/b> alias of <b>Invoke-Expression<\/b>. The next three statements are equivalent, and they can be used interchangeably:<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; Invoke-Expression -Command &quot;111 * 111&quot;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; 12321<\/p>\n<p class=\"Code\">&nbsp;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; &quot;111 * 111&quot; | Invoke-Expression<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; 12321<\/p>\n<p class=\"Code\">&nbsp;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; &quot;111 * 111&quot; | iex<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">PS C:\\&gt; 12321<\/p>\n<p class=\"Code\"><span style=\"font-size:12px\">This <\/span><b style=\"font-size:12px\">Invoke-Expression<\/b><span style=\"font-size:12px\"> feature gives Doug the product for his &quot;ones x ones = product&quot; statement. Let&#039;s add the statement to the <\/span><b style=\"font-size:12px\">For<\/b><span style=\"font-size:12px\"> loop block:<\/span><\/p>\n<p class=\"Code\" style=\"margin-left:30px\">for ($i = 1; $i -le 8; $i++)<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">{<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; $n = &quot;1&quot; * $i<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; $n + &quot; x &quot; + $n&nbsp; + &quot; = &quot; +<\/p>\n<p class=\"Code\">&nbsp;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; (&quot;$n * $n&quot; | iex)<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">}<\/p>\n<p>&nbsp;<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1 x 1 = 1<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11 x 11 = 121<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">111 x 111 = 12321<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1111 x 1111 = 1234321<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11111 x 11111 = 123454321<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">111111 x 111111 = 12345654321<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">1111111 x 1111111 = 1234567654321<\/p>\n<p class=\"Code\" style=\"margin-left:30px\">11111111 x 11111111 = 123456787654321<\/p>\n<p>This completes the task. It&#039;s tricky, but it works. In tomorrow&#039;s post, we&#039;ll talk about the techniques that Doug uses, including an interesting loop and pretty formatting. Stay tuned!<\/p>\n<p>We invite you to follow us on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\" target=\"_blank\">Facebook<\/a>. If you have any questions, send email to <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\">Official Scripting Guys Forum<\/a>. See you tomorrow.<\/p>\n<p><b>June Blender, <\/b>Honorary Scripting Guy<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: June Blender explains Doug Finke&#039;s multiplication and formatting trick. Today&#8230;the task. Microsoft Scripting Guy, Ed Wilson, is here. Today, Honorary Scripting Guy, June Blender, examines a multiplication and formatting trick that Doug Finke posted on the PowerShell Facebook page. I&#039;ve broken this article into two parts: Part 1: The Task &nbsp;&nbsp;Explains what Doug was [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[56,370,3,4,336,45],"class_list":["post-643","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-guest-blogger","tag-june-blender","tag-scripting-guy","tag-scripting-techniques","tag-strings","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: June Blender explains Doug Finke&#039;s multiplication and formatting trick. Today&#8230;the task. Microsoft Scripting Guy, Ed Wilson, is here. Today, Honorary Scripting Guy, June Blender, examines a multiplication and formatting trick that Doug Finke posted on the PowerShell Facebook page. I&#039;ve broken this article into two parts: Part 1: The Task &nbsp;&nbsp;Explains what Doug was [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=643"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/643\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}