{"id":1953,"date":"2012-01-03T11:38:22","date_gmt":"2012-01-03T16:38:22","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1953"},"modified":"2021-02-16T15:04:34","modified_gmt":"2021-02-16T20:04:34","slug":"format-leading-zeros-in-powershell","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1953\/format-leading-zeros-in-powershell\/","title":{"rendered":"Format Leading Zeros in PowerShell"},"content":{"rendered":"\n<p>I've been working on a question in the forums at ScriptingAnswers.com and the need arose to create a folder name with a 4 digit number. But the number needed to have enough leading zeros so that the number was always 4 digits. For example, Test_0005 or Test_0456. The solution is to use the -f Format operator.<\/p>\n\n\n\n<p>To use this operator on the left side of the statement is a formatting directive and on the right side of the -f operator is the value to be formatted. To get the leading zeros I'm going to use a formatting string like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\"> <code>\"{0:0000}\"<\/code><\/code><\/pre>\n\n\n\n<p>This basically says, \"take a value and make pad it with 4 0s. Here are some examples:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted lang:ps decode:true\">PS C:\\&gt; \"{0:0000}\" -f 4\n0004\nPS C:\\&gt; \"{0:0000}\" -f 45\n0045\nPS C:\\&gt; \"{0:0000}\" -f 456\n0456\nPS C:\\&gt; \"{0:0000}\" -f 4567\n4567\n<\/pre>\n\n\n\n<p>Technically, these are string objects, but that's ok. Let's see how we might use this.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted lang:ps decode:true\">PS C:\\&gt; 1..10 | foreach {\n&gt;&gt;  $i=\"{0:0000}\" -f $_\n&gt;&gt;  $dir=\"c:\\test\\Target_$i\"\n&gt;&gt;  $file=\"file_$i.txt\"\n&gt;&gt;  $target=Join-Path -Path $dir -ChildPath $file\n&gt;&gt;  Write-Host \"Updating $target\"\n&gt;&gt;\n&gt;&gt;  }\n&gt;&gt;\nUpdating c:\\test\\Target_0001\\file_0001.txt\nUpdating c:\\test\\Target_0002\\file_0002.txt\nUpdating c:\\test\\Target_0003\\file_0003.txt\nUpdating c:\\test\\Target_0004\\file_0004.txt\nUpdating c:\\test\\Target_0005\\file_0005.txt\nUpdating c:\\test\\Target_0006\\file_0006.txt\nUpdating c:\\test\\Target_0007\\file_0007.txt\nUpdating c:\\test\\Target_0008\\file_0008.txt\nUpdating c:\\test\\Target_0009\\file_0009.txt\nUpdating c:\\test\\Target_0010\\file_0010.txt\nPS C:\\&gt;\n<\/pre>\n\n\n\n<p>Within the Foreach loop I'm taking the piped in number and formatting to 4 places with leading zeros. This value is then inserted into variables for paths and files, using Join-Path to combine them. This is a much better technique than trying to concatenate.<\/p>\n\n\n\n<p>I hope you find this useful.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been working on a question in the forums at ScriptingAnswers.com and the need arose to create a folder name with a 4 digit number. But the number needed to have enough leading zeros so that the number was always 4 digits. For example, Test_0005 or Test_0456. The solution is to use the -f Format&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,8],"tags":[350,251,534],"class_list":["post-1953","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-format","tag-join-path","tag-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Format Leading Zeros in PowerShell &#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\/1953\/format-leading-zeros-in-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Format Leading Zeros in PowerShell &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I&#039;ve been working on a question in the forums at ScriptingAnswers.com and the need arose to create a folder name with a 4 digit number. But the number needed to have enough leading zeros so that the number was always 4 digits. For example, Test_0005 or Test_0456. The solution is to use the -f Format...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/1953\/format-leading-zeros-in-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2012-01-03T16:38:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-16T20:04:34+00:00\" \/>\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\\\/1953\\\/format-leading-zeros-in-powershell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1953\\\/format-leading-zeros-in-powershell\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Format Leading Zeros in PowerShell\",\"datePublished\":\"2012-01-03T16:38:22+00:00\",\"dateModified\":\"2021-02-16T20:04:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1953\\\/format-leading-zeros-in-powershell\\\/\"},\"wordCount\":189,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Format\",\"Join-Path\",\"PowerShell\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1953\\\/format-leading-zeros-in-powershell\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1953\\\/format-leading-zeros-in-powershell\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1953\\\/format-leading-zeros-in-powershell\\\/\",\"name\":\"Format Leading Zeros in PowerShell &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2012-01-03T16:38:22+00:00\",\"dateModified\":\"2021-02-16T20:04:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1953\\\/format-leading-zeros-in-powershell\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1953\\\/format-leading-zeros-in-powershell\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1953\\\/format-leading-zeros-in-powershell\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Format Leading Zeros in PowerShell\"}]},{\"@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":"Format Leading Zeros in PowerShell &#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\/1953\/format-leading-zeros-in-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Format Leading Zeros in PowerShell &#8226; The Lonely Administrator","og_description":"I've been working on a question in the forums at ScriptingAnswers.com and the need arose to create a folder name with a 4 digit number. But the number needed to have enough leading zeros so that the number was always 4 digits. For example, Test_0005 or Test_0456. The solution is to use the -f Format...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1953\/format-leading-zeros-in-powershell\/","og_site_name":"The Lonely Administrator","article_published_time":"2012-01-03T16:38:22+00:00","article_modified_time":"2021-02-16T20:04:34+00:00","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\/1953\/format-leading-zeros-in-powershell\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1953\/format-leading-zeros-in-powershell\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Format Leading Zeros in PowerShell","datePublished":"2012-01-03T16:38:22+00:00","dateModified":"2021-02-16T20:04:34+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1953\/format-leading-zeros-in-powershell\/"},"wordCount":189,"commentCount":5,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Format","Join-Path","PowerShell"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1953\/format-leading-zeros-in-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1953\/format-leading-zeros-in-powershell\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1953\/format-leading-zeros-in-powershell\/","name":"Format Leading Zeros in PowerShell &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2012-01-03T16:38:22+00:00","dateModified":"2021-02-16T20:04:34+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1953\/format-leading-zeros-in-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1953\/format-leading-zeros-in-powershell\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1953\/format-leading-zeros-in-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Format Leading Zeros in PowerShell"}]},{"@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":7565,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7565\/formatting-powershell-timespans\/","url_meta":{"origin":1953,"position":0},"title":"Formatting PowerShell TimeSpans","author":"Jeffery Hicks","date":"June 24, 2020","format":false,"excerpt":"I often will figure out how to do something and later struggle to remember how to do it a months later. Rather than trying to remember what piece of code I wrote,\u00a0 why not write about. Assuming I can remember! Anyway, here's today's \"PSRemembery\". I often\u00a0 use code like this,\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\/timespan-6.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/timespan-6.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/timespan-6.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/timespan-6.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/06\/timespan-6.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":434,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/434\/get-numberedcontent\/","url_meta":{"origin":1953,"position":1},"title":"Get-NumberedContent","author":"Jeffery Hicks","date":"October 9, 2009","format":false,"excerpt":"One of the reasons I enjoy Twitter is that it exposes me to PowerShell ideas and enthusiasts beyond my immediate circle. I came across a blog post from David Longnecker about a short function to display file content in a numbered format. Basically taking Get-Content and adding a line number\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"captured_Image.png","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2009\/10\/captured_Image1.png_thumb1.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":959,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/959\/custom-prompts-3-ways\/","url_meta":{"origin":1953,"position":2},"title":"Custom Prompts 3 Ways","author":"Jeffery Hicks","date":"October 12, 2010","format":false,"excerpt":"Recently, a number of PowerShell MVPs were having a discussion about the transcript feature in Windows PowerShell. One comment that arose was a need to see how long tasks have run or otherwise provide some sort of date time information. One solution is to use a customized PowerShell prompt and\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/10\/colorprompt-300x127.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":8629,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8629\/friday-fun-a-powershell-welcome\/","url_meta":{"origin":1953,"position":3},"title":"Friday Fun: A PowerShell Welcome","author":"Jeffery Hicks","date":"October 15, 2021","format":false,"excerpt":"I realized it had been a while since I wrote a Friday Fun post. These posts are intended to demonstrate PowerShell in a fun and often non-practical way. The end result is generally irrelevant. The PowerShell scripting techniques and concepts I use are the real takeaways. The task is nothing\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\/2021\/10\/welcome-ps.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/10\/welcome-ps.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/10\/welcome-ps.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":3872,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3872\/friday-fun-with-formatting\/","url_meta":{"origin":1953,"position":4},"title":"Friday Fun with Formatting","author":"Jeffery Hicks","date":"May 30, 2014","format":false,"excerpt":"PowerShell is very adept at retrieving all sorts of information from computer systems in your network. Often the data is in a format that is hard to digest at a glance. For example, when you see a value like 1202716672 is that something in MB or GB? What if 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":"formatfunctions","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/formatfunctions-300x73.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":7494,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7494\/solving-the-powershell-counting-challenge\/","url_meta":{"origin":1953,"position":5},"title":"Solving the PowerShell Counting Challenge","author":"Jeffery Hicks","date":"May 27, 2020","format":false,"excerpt":"A few weeks ago, an Iron Scripter PowerShell scripting challenge was posted. As with all of these challenges, the process is more important than the end result. How you figure out a solution is how you develop as a PowerShell professional. A few people have already shared their work. Today,\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"nfactorial","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/nfactorial.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/nfactorial.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/nfactorial.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/nfactorial.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/nfactorial.jpg?resize=1050%2C600&ssl=1 3x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1953","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=1953"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1953\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}