PowerShell Live! : Looping and Branching

4/26/2018 2733 Contributors

Download your trial of PDQ Deploy & Inventory: https://www.pdq.com/products/

Question: Can you point to some background material or examples of looping and branching? I’ve done looping in Batch (for, if/else, while, etc.) but would like to see how that looks in PowerShell: 1:13

Looping and Branching: 4:33

If / Else / WhatIf: 5:14

Switch statement: 11:52

Question: When should you use the ForEach-Object cmdlet vs just ForEach? 17:12

ForEach: 18:05

ForEach Object: 19:46

Question: Can you test a loop in PowerShell before running the script? Check to make sure that the ForEach statements are correct and not a broken loop? 23:04

Ranges: 25:02

For: 26:44

Question: Can you have too many ‘if’s in a script? Should you limit it to a certain amount? 28:33