{"componentChunkName":"component---src-templates-articles-index-jsx","path":"/articles/powershell-for-loop/","result":{"data":{"props":{"adsense":true,"adsenseMobile":null,"byLine":"","canonical":"https://staging.business.com/articles/powershell-for-loop/","content":"\n<p>In this PowerShell tutorial we show you how to use the For loop, ForEach-Object loop, and the While, Do-While and Do-Until loops.</p>\r\n<p><picture class=\"aligncenter full\">PowerShell loops, at their most basic, simply repeat the same set of commands a set number of times. Ideal for performing consistent actions for a set period of time or a certain number of records, loops can simplify your scripts in a big way. PowerShell in particular features a number of cmdlets -- notably those that begin with the verb Get -- which return objects containing large numbers of similar data.</picture><br><picture class=\"aligncenter full\"><source srcset=\"/images/content/5b6/d155751ee4753518b4583/1200_-900- 1200w, /images/content/5b6/d155751ee4753518b4583/668_-501- 668w, /images/content/5b6/d155751ee4753518b4583/320_-240- 320w\" sizes=\"668px, 100%\"></source></picture></p>\r\n<p>There are several types of loops available in PowerShell, and in many cases more than one loop technique can be used effectively. At times determining the most efficient loop type is required, either from a performance or code readability perspective.</p>\r\n<div id=\"in-article-vca-1\"> </div>\r\n<h2>ForEach-Object Loop</h2>\r\n<p><picture class=\"aligncenter full\"><source srcset=\"/images/content/5b6/d15af1039ebe4508b4583/1200_-931- 1200w, /images/content/5b6/d15af1039ebe4508b4583/668_-518- 668w, /images/content/5b6/d15af1039ebe4508b4583/320_-248- 320w\" sizes=\"668px, 100%\"></source><img src=\"/images/content/5b6/d15af1039ebe4508b4583/1040-807-\" alt=\"\" width=\"1040\" height=\"807\" data-content-img-id=\"5b6d15af1039ebe4508b4583\"></picture></p>\r\n<p>In many cases using the <strong>ForEach-Object</strong> cmdlet (previously discussed in our article on <a href=\"http://www.tomsitpro.com/articles/powershell-piping-filtering-objects,2-771.html\" target=\"_blank\">working with PowerShell objects</a>) is the best way to loop through an object. At it's most simple, ForEach-Object requires only an object to be looped through and a script block containing the commands to be performed on each member of the object. <br><br>These parameters can be specified either by the <strong>-InputObject</strong> and <strong>-Process</strong> parameter names, or by piping the object to the ForEach-Object cmdlet and placing the script block as the first parameter. To illustrate this basic syntax the following example shows two methods of using ForEach-Object to loop through the contents of a user's Documents folder:</p>\r\n<blockquote>\r\n<p>$myDocuments = Get-ChildItem $env:USERPROFILEDocuments -File<br> $myDocuments | ForEach-Object {$_.FullName}<br> ForEach-Object -InputObject $myDocuments -Process {$_.FullName}</p>\r\n</blockquote>\r\n<p>In certain scenarios it may be beneficial to perform one or more actions just before or just after the loop is performed. The<strong> -Begin</strong> and <strong>-End </strong>parameters can be used to define script blocks to execute just before or after the contents of the -Process script block. This can be used to set or modify a variable before or after execution of the loop.</p>\r\n<p>ForEach-Object has two aliases, <strong>ForEach</strong> and <strong>%</strong>, and also supports shorthand syntax beginning in PowerShell 3.0. The following three examples are identical in function.</p>\r\n<blockquote>\r\n<p>Get-WMIObject Win32_LogicalDisk | ForEach-Object {$_.FreeSpace}<br> Get-WMIObject Win32_LogicalDisk | ForEach {$_.FreeSpace}<br> Get-WMIObject Win32_LogicalDisk | % FreeSpace</p>\r\n</blockquote>\r\n<h2>PowerShell For Loop</h2>\r\n<p><picture class=\"aligncenter full\"><source srcset=\"/images/content/5b6/d162192a3a4044d8b458b/1200_-931- 1200w, /images/content/5b6/d162192a3a4044d8b458b/668_-518- 668w, /images/content/5b6/d162192a3a4044d8b458b/320_-248- 320w\" sizes=\"668px, 100%\"></source><img src=\"/images/content/5b6/d162192a3a4044d8b458b/1040-807-\" alt=\"\" width=\"1040\" height=\"807\" data-content-img-id=\"5b6d162192a3a4044d8b458b\"></picture></p>\r\n<p>For loops are typically used to iterate through a set of commands a specified number of times, either to step through an array or object, or just to repeat the same block of code as needed. A For loop is constructed by setting the value of a variable when entering the loop, the condition on which the loop should be terminated, and an action to be performed against that variable each time through the loop.</p>\r\n<p>The following example shows a basic For loop used to create a multiplication table:</p>\r\n<blockquote>\r\n<p>For ($i=0; $i -le 10; $i++) {<br>    \"10 * $i = \" + (10 * $i)<br>    }</p>\r\n</blockquote>\r\n<p>For loops can be used to step through array values by setting the initial value to the initial index of the array and incrementally increasing the value until the array length is met. The array index is specified by placing the incremented variable inside square brackets immediately following the variable name, as shown in the following example:</p>\r\n<blockquote>\r\n<p>$colors = @(\"Red\",\"Orange\",\"Yellow\",\"Green\",\"Blue\",\"Indigo\",\"Violet\")<br> For ($i=0; $i -lt $colors.Length; $i++) {<br>    $colors[$i]<br>    }</p>\r\n</blockquote>\r\n<h2>While, Do-While, and Do-Until Loops</h2>\r\n<p><picture class=\"aligncenter full\"><source srcset=\"/images/content/5b6/d168892a3a4f64c8b457a/1200_-931- 1200w, /images/content/5b6/d168892a3a4f64c8b457a/668_-518- 668w, /images/content/5b6/d168892a3a4f64c8b457a/320_-248- 320w\" sizes=\"668px, 100%\"></source><img src=\"/images/content/5b6/d168892a3a4f64c8b457a/1040-807-\" alt=\"\" width=\"1040\" height=\"807\" data-content-img-id=\"5b6d168892a3a4f64c8b457a\"></picture></p>\r\n<p>A third type of loop that PowerShell supports involves setting a condition which either allows the loop to process as long as the condition is true or until it is met. <strong>While</strong> and <strong>Do-While</strong> loops are both used to perform an action while the condition evaluates to <strong>$true</strong>, and differ only in their syntax. <strong>Do-Until</strong> loops have similar syntax to Do-While, but stop processing once the condition statement is met.</p>\r\n<p>Do-While and Do-Until loops both begin with the Do keyword prefacing a script block, followed by the condition keyword (While or Until) and the condition. As an example the following two loops function identically, only the condition is reversed:</p>\r\n<blockquote>\r\n<p>$i=1<br> Do {<br>    $i<br>    $i++<br>    }<br> While ($i -le 10)</p>\r\n<p>$i=1<br> Do {<br>    $i<br>    $i++<br>    }<br> Until ($i -gt 10)</p>\r\n</blockquote>\r\n<p>While loops perform identically to Do-While loops, only the syntax is altered slightly. While loops use only the While keyword, followed by the condition, and finally the script block. This loop is identical in function to the preceding examples, and uses the same condition as the Do-While loop:</p>\r\n<blockquote>\r\n<p>$i=1<br> While ($i -le 10)<br>    {<br>    $i<br>    $i++<br>    }</p>\r\n</blockquote>\r\n<p>Any of these three loop types -- Do-While, Do-Until, and While loops -- can also be used to loop indefinitely; While and Do-While loops with the condition set to $true and Do-Until with the condition set to $false.</p>\r\n<p>In some situations you may need to exit a loop early based on something other than the loops condition. In this case the <strong><em>Break</em></strong> keyword can be invoked in order to exit out of the loop. This final example shows the same functionality, but uses an infinite loop and the Break keyword to exit out at the appropriate time:</p>\r\n<blockquote>\r\n<p>$i=1<br> While ($true)<br>    {<br>    $i<br>    $i++<br>    if ($i -gt 10) {<br>        Break<br>        }<br>    }</p>\r\n</blockquote>\r\n<div id=\"in-article-vca-2\"> </div>\n","docType":"article","guid":"articles_835d7da800d894c40f174cbfa2cdfe9a","lastModified":"2018-09-06T09:00:00.000Z","published":"2018-09-06T08:00:00.000Z","structuredData":null,"subtitle":"We show you how to use the For loop, For Each-Object loop, and the While, and Do-While.","template":"v1","title":"PowerShell Basics: Programming With Loops","type":"article","author":{"avatar":null,"bio":null,"name":"Tim Ferrell","image":null,"slug":null,"social":{"facebook":"","linkedin":"","twitter":null,"website":"http://www.business.com"},"status":"enabled","title":null,"type":"Contributing Writer","user":{"imagePath":"https://staging.business.com/images/undefined","profile":{"company":"Website and Mobile Application Development","jobTitle":"","website":"http://www.virinchisoftware.com/"}}},"breadcrumbs":null,"channels":{"primary":{"name":"Technology","slug":"technology"},"sub":{"name":"Technology Solutions","slug":"technology-solutions"}},"meta":{"robots":"index, follow","description":"In this PowerShell tutorial we show you how to use the For loop, ForEach-Object loop, and the While, Do-While and Do-Until loops.","title":"PowerShell For Loop, For Each-Object Loop & Other Loops - business.com"},"parsedContent":{"toc":[{"id":"foreach-object-loop","title":"ForEach-Object Loop"},{"id":"powershell-for-loop","title":"PowerShell For Loop"},{"id":"while,-do-while,-and-do-until-loops","title":"While, Do-While, and Do-Until Loops"}],"json":[{"component":"p","children":["In this PowerShell tutorial we show you how to use the For loop, ForEach-Object loop, and the While, Do-While and Do-Until loops."]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter full"},"children":["PowerShell loops, at their most basic, simply repeat the same set of commands a set number of times. Ideal for performing consistent actions for a set period of time or a certain number of records, loops can simplify your scripts in a big way. PowerShell in particular features a number of cmdlets -- notably those that begin with the verb Get -- which return objects containing large numbers of similar data."]},{"component":"br"},{"component":"picture","props":{"className":"aligncenter full"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/d155751ee4753518b4583/1200_-900- 1200w, /images/content/5b6/d155751ee4753518b4583/668_-501- 668w, /images/content/5b6/d155751ee4753518b4583/320_-240- 320w","sizes":"668px, 100%"}}]}]},{"component":"p","children":["There are several types of loops available in PowerShell, and in many cases more than one loop technique can be used effectively. At times determining the most efficient loop type is required, either from a performance or code readability perspective."]},{"component":"div","props":{"id":"in-article-vca-1"},"children":[" "]},{"component":"h2","props":{"id":"foreach-object-loop"},"children":["ForEach-Object Loop"]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter full"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/d15af1039ebe4508b4583/1200_-931- 1200w, /images/content/5b6/d15af1039ebe4508b4583/668_-518- 668w, /images/content/5b6/d15af1039ebe4508b4583/320_-248- 320w","sizes":"668px, 100%"}},{"component":"img","props":{"src":"/images/content/5b6/d15af1039ebe4508b4583/1040-807-","alt":"","width":"1040","height":"807","data-content-img-id":"5b6d15af1039ebe4508b4583"}}]}]},{"component":"p","children":["In many cases using the ",{"component":"strong","children":["ForEach-Object"]}," cmdlet (previously discussed in our article on ",{"component":"a","props":{"href":"http://www.tomsitpro.com/articles/powershell-piping-filtering-objects,2-771.html","target":"_blank"},"children":["working with PowerShell objects"]},") is the best way to loop through an object. At it's most simple, ForEach-Object requires only an object to be looped through and a script block containing the commands to be performed on each member of the object. ",{"component":"br"},{"component":"br"},"These parameters can be specified either by the ",{"component":"strong","children":["-InputObject"]}," and ",{"component":"strong","children":["-Process"]}," parameter names, or by piping the object to the ForEach-Object cmdlet and placing the script block as the first parameter. To illustrate this basic syntax the following example shows two methods of using ForEach-Object to loop through the contents of a user's Documents folder:"]},{"component":"blockquote","children":[{"component":"p","children":["$myDocuments = Get-ChildItem $env:USERPROFILEDocuments -File",{"component":"br"}," $myDocuments | ForEach-Object {$_.FullName}",{"component":"br"}," ForEach-Object -InputObject $myDocuments -Process {$_.FullName}"]}]},{"component":"p","children":["In certain scenarios it may be beneficial to perform one or more actions just before or just after the loop is performed. The",{"component":"strong","children":[" -Begin"]}," and ",{"component":"strong","children":["-End "]},"parameters can be used to define script blocks to execute just before or after the contents of the -Process script block. This can be used to set or modify a variable before or after execution of the loop."]},{"component":"p","children":["ForEach-Object has two aliases, ",{"component":"strong","children":["ForEach"]}," and ",{"component":"strong","children":["%"]},", and also supports shorthand syntax beginning in PowerShell 3.0. The following three examples are identical in function."]},{"component":"blockquote","children":[{"component":"p","children":["Get-WMIObject Win32_LogicalDisk | ForEach-Object {$_.FreeSpace}",{"component":"br"}," Get-WMIObject Win32_LogicalDisk | ForEach {$_.FreeSpace}",{"component":"br"}," Get-WMIObject Win32_LogicalDisk | % FreeSpace"]}]},{"component":"h2","props":{"id":"powershell-for-loop"},"children":["PowerShell For Loop"]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter full"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/d162192a3a4044d8b458b/1200_-931- 1200w, /images/content/5b6/d162192a3a4044d8b458b/668_-518- 668w, /images/content/5b6/d162192a3a4044d8b458b/320_-248- 320w","sizes":"668px, 100%"}},{"component":"img","props":{"src":"/images/content/5b6/d162192a3a4044d8b458b/1040-807-","alt":"","width":"1040","height":"807","data-content-img-id":"5b6d162192a3a4044d8b458b"}}]}]},{"component":"p","children":["For loops are typically used to iterate through a set of commands a specified number of times, either to step through an array or object, or just to repeat the same block of code as needed. A For loop is constructed by setting the value of a variable when entering the loop, the condition on which the loop should be terminated, and an action to be performed against that variable each time through the loop."]},{"component":"p","children":["The following example shows a basic For loop used to create a multiplication table:"]},{"component":"blockquote","children":[{"component":"p","children":["For ($i=0; $i -le 10; $i++) {",{"component":"br"},"    \"10 * $i = \" + (10 * $i)",{"component":"br"},"    }"]}]},{"component":"p","children":["For loops can be used to step through array values by setting the initial value to the initial index of the array and incrementally increasing the value until the array length is met. The array index is specified by placing the incremented variable inside square brackets immediately following the variable name, as shown in the following example:"]},{"component":"blockquote","children":[{"component":"p","children":["$colors = @(\"Red\",\"Orange\",\"Yellow\",\"Green\",\"Blue\",\"Indigo\",\"Violet\")",{"component":"br"}," For ($i=0; $i -lt $colors.Length; $i++) {",{"component":"br"},"    $colors[$i]",{"component":"br"},"    }"]}]},{"component":"h2","props":{"id":"while,-do-while,-and-do-until-loops"},"children":["While, Do-While, and Do-Until Loops"]},{"component":"p","children":[{"component":"picture","props":{"className":"aligncenter full"},"children":[{"component":"source","props":{"srcSet":"/images/content/5b6/d168892a3a4f64c8b457a/1200_-931- 1200w, /images/content/5b6/d168892a3a4f64c8b457a/668_-518- 668w, /images/content/5b6/d168892a3a4f64c8b457a/320_-248- 320w","sizes":"668px, 100%"}},{"component":"img","props":{"src":"/images/content/5b6/d168892a3a4f64c8b457a/1040-807-","alt":"","width":"1040","height":"807","data-content-img-id":"5b6d168892a3a4f64c8b457a"}}]}]},{"component":"p","children":["A third type of loop that PowerShell supports involves setting a condition which either allows the loop to process as long as the condition is true or until it is met. ",{"component":"strong","children":["While"]}," and ",{"component":"strong","children":["Do-While"]}," loops are both used to perform an action while the condition evaluates to ",{"component":"strong","children":["$true"]},", and differ only in their syntax. ",{"component":"strong","children":["Do-Until"]}," loops have similar syntax to Do-While, but stop processing once the condition statement is met."]},{"component":"p","children":["Do-While and Do-Until loops both begin with the Do keyword prefacing a script block, followed by the condition keyword (While or Until) and the condition. As an example the following two loops function identically, only the condition is reversed:"]},{"component":"blockquote","children":[{"component":"p","children":["$i=1",{"component":"br"}," Do {",{"component":"br"},"    $i",{"component":"br"},"    $i++",{"component":"br"},"    }",{"component":"br"}," While ($i -le 10)"]},{"component":"p","children":["$i=1",{"component":"br"}," Do {",{"component":"br"},"    $i",{"component":"br"},"    $i++",{"component":"br"},"    }",{"component":"br"}," Until ($i -gt 10)"]}]},{"component":"p","children":["While loops perform identically to Do-While loops, only the syntax is altered slightly. While loops use only the While keyword, followed by the condition, and finally the script block. This loop is identical in function to the preceding examples, and uses the same condition as the Do-While loop:"]},{"component":"blockquote","children":[{"component":"p","children":["$i=1",{"component":"br"}," While ($i -le 10)",{"component":"br"},"    {",{"component":"br"},"    $i",{"component":"br"},"    $i++",{"component":"br"},"    }"]}]},{"component":"p","children":["Any of these three loop types -- Do-While, Do-Until, and While loops -- can also be used to loop indefinitely; While and Do-While loops with the condition set to $true and Do-Until with the condition set to $false."]},{"component":"p","children":["In some situations you may need to exit a loop early based on something other than the loops condition. In this case the ",{"component":"strong","children":[{"component":"em","children":["Break"]}]}," keyword can be invoked in order to exit out of the loop. This final example shows the same functionality, but uses an infinite loop and the Break keyword to exit out at the appropriate time:"]},{"component":"blockquote","children":[{"component":"p","children":["$i=1",{"component":"br"}," While ($true)",{"component":"br"},"    {",{"component":"br"},"    $i",{"component":"br"},"    $i++",{"component":"br"},"    if ($i -gt 10) {",{"component":"br"},"        Break",{"component":"br"},"        }",{"component":"br"},"    }"]}]},{"component":"div","props":{"id":"in-article-vca-2"},"children":[" "]}]},"resource":null,"sponsorship":null,"thumbnail":{"path":"https://staging.business.com/images/content/5db/f21b59c658a01188b4584/1500-0-","caption":"scyther5/Getty","isBlurred":false},"bestPicks":null},"related":{"relatedArticles":[{"title":"PowerShell Basics: Programming With Loops","canonical":"https://www.business.com/articles/powershell-for-loop/","slug":"powershell-for-loop","thumbnail":"https://www.business.com/images/content/5db/f21b59c658a01188b4584/1500-0-","dek":"We show you how to use the For loop, For Each-Object loop, and the While, and Do-While.","lastModified":"2018-09-06T09:00:00Z","published":"2018-09-06T08:00:00Z","sponsored":false},{"title":"PowerShell: Everything You Need to Know","canonical":"https://www.business.com/articles/powershell-everything-you-need-to-know/","slug":"powershell-everything-you-need-to-know","thumbnail":"https://www.business.com/images/content/5b8/998581039eb8f738b457b/1500-0-","dek":"What you need to know to unlock Microsoft PowerShell's full capabilities.","lastModified":"2018-09-05T17:00:00Z","published":"2018-09-05T17:00:00Z","sponsored":false},{"title":"Essential PowerShell Cmdlets For Auditing And Maintaining Storage","canonical":"https://www.business.com/articles/powershell-for-storage/","slug":"powershell-for-storage","thumbnail":"https://www.business.com/images/content/5d0/18e065a215ea2498b4588/1500-0-","dek":"PowerShell v5 offers some new features for managing storage.","lastModified":"2018-09-04T11:00:00Z","published":"2018-09-04T11:00:00Z","sponsored":false},{"title":"Using Lean Strategies to Achieve Team Synergy and Efficiency","canonical":"https://www.business.com/articles/lean-strategies-team-efficiency/","slug":"lean-strategies-team-efficiency","thumbnail":"https://www.business.com/images/content/5be/480e49c658a51108b458c/1500-0-","dek":"Learn more about lean manufacturing strategies and how to implement them in your business.","lastModified":"2018-11-08T08:00:00Z","published":"2018-11-08T08:00:00Z","sponsored":false},{"title":"Your Guide to Creating a Small Business Marketing Plan","canonical":"https://www.business.com/articles/sample-marketing-plan-outline-and-template/","slug":"sample-marketing-plan-outline-and-template","thumbnail":"https://www.business.com/images/content/5f3/3e1765a215eb62d8b4567/1500-0-","dek":"Follow these templates and guidelines to get started on creating your business's marketing plan.","lastModified":"2020-08-12T12:28:00Z","published":"2018-03-02T13:00:00Z","sponsored":false},{"title":"From COVID-19 to Hurricane Season: Disaster Preparedness for Small Business","canonical":"https://www.business.com/articles/business-disaster-prep/","slug":"business-disaster-prep","thumbnail":"https://www.business.com/images/content/5e7/a495e5a215eb11d8b4569/1500-0-","dek":"Natural disasters – whether a hurricane, tornado or outbreak like COVID-19 – can have a disastrous effect on small businesses, but they don't have to. Here's how to weather a disaster successfully.","lastModified":"2020-03-25T15:19:00Z","published":"2018-09-26T07:00:00Z","sponsored":false},{"title":"How to Hire for Your Business","canonical":"https://www.business.com/articles/how-to-staff-business/","slug":"how-to-staff-business","thumbnail":"https://www.business.com/images/content/5ea/9c8bb9c658aee018b456c/1500-0-","dek":"Sterling Staffing Solutions CEO Stephen Carter shares his tips on staffing your business.","lastModified":"2020-07-31T15:00:00Z","published":"2018-08-16T12:00:00Z","sponsored":false},{"title":"Essential PowerShell Cmdlets For Managing Active Directory","canonical":"https://www.business.com/articles/powershell-active-directory-cmdlets/","slug":"powershell-active-directory-cmdlets","thumbnail":"https://www.business.com/images/content/5cf/90cab7b4374ab068b456f/1500-0-","dek":"Administering Active Directory is one of the most critical roles in any Windows network.","lastModified":"2018-09-04T08:00:00Z","published":"2018-09-04T08:00:00Z","sponsored":false},{"title":"What to Do if ICE Serves Your Business With a Form I-9 Audit","canonical":"https://www.business.com/articles/ice-serves-i-9-audit/","slug":"ice-serves-i-9-audit","thumbnail":"https://www.business.com/images/content/5e6/64def7b43740a2a8b456e/1500-0-","dek":"Make sure you're prepared should Immigration and Customs Enforcement come knocking.","lastModified":"2020-03-10T15:00:00Z","published":"2018-09-17T18:00:00Z","sponsored":false},{"title":"What Is the Triple Bottom Line?","canonical":"https://www.business.com/articles/triple-bottom-line-defined/","slug":"triple-bottom-line-defined","thumbnail":"https://www.business.com/images/content/5e8/c6d029c658a03718b456a/1500-0-","dek":"The triple bottom line is a sustainability-based accounting method that focuses on people, profit and planet. Here's how it works for businesses.","lastModified":"2020-04-10T12:17:00Z","published":"2018-07-26T17:00:00Z","sponsored":false},{"title":"How to Choose the Best Business Loan","canonical":"https://www.business.com/articles/how-to-choose-a-business-loan/","slug":"how-to-choose-a-business-loan","thumbnail":"https://www.business.com/images/content/5db/c5c175a215e47798b456f/1500-0-","dek":"Small businesses have a lot of funding options, but choose wisely.","lastModified":"2020-02-04T14:25:00Z","published":"2020-02-04T14:25:00Z","sponsored":false},{"title":"Resources for Veteran-Owned Businesses","canonical":"https://www.business.com/articles/resources-veteran-owned-business/","slug":"resources-veteran-owned-business","thumbnail":"https://www.business.com/images/content/5b7/425da51ee47e7568b458a/1500-0-","dek":"How to start a business, find funding and gain customers as a veteran business owner.","lastModified":"2018-08-15T12:01:00Z","published":"2018-08-15T12:01:00Z","sponsored":false}],"relatedReviews":[{"doc_type":"category","thumbnail":"https://staging.business.com/images/rz/5df908cc5a215e8c4a8b4568/conferencecall_Antonio_Diaz_Getty.jpg","canonical":"https://staging.business.com/categories/best-conference-call-services/","title":"The Best Conference Call Services of 2021","dek":"Which conference call service is right for your business in 2021? We review the top-rated services.","slug":"best-conference-call-services","lastModified":"2021-03-17T18:17:00Z"},{"doc_type":"category","thumbnail":"https://staging.business.com/images/rz/5df3d8695a215e58428b4570/POS_GETTY_DERO2084.jpg","canonical":"https://staging.business.com/categories/best-pos-systems/","title":"The Best POS Systems of 2021","dek":"Before you choose a POS system, check out our reviews of the best picks for 2021. ","slug":"best-pos-systems","lastModified":"2021-03-17T17:33:00Z"},{"doc_type":"category","thumbnail":"https://staging.business.com/images/rz/5e00d4787b43745d6a8b456e/Laptop_undrey_getty.jpg","canonical":"https://staging.business.com/categories/employee-monitoring-software/","title":"The Best Employee Monitoring Software of 2021","dek":"We've narrowed down the best employee monitoring software for businesses. Check out our best picks and reviews.","slug":"employee-monitoring-software","lastModified":"2021-03-05T15:40:00Z"}],"relatedSponsoredArticles":null}},"pageContext":{"displayModified":"2018-09-06T09:00:00.000Z","template":"v1","title":"PowerShell Basics: Programming With Loops","meta":{"robots":"index, follow"},"docType":"articles","slug":"powershell-for-loop","canonical":"https://staging.business.com/articles/powershell-for-loop/","skipTOC":false}},"staticQueryHashes":[]}