When working with object collections in PowerShell, they are often used as input for the ForEach-Object cmdlet, the foreach method, or the foreach statement.
This recipe will show you when to use the cmdlet, the method, or the statement, and the key differences between all of them.