foreach array element powershell loop code example
Example 1: foreach loop powershell
foreach ($item in $items) {
## Do something to each item
}
Example 2: powershell foreach
ForEach-Object
[-InputObject <PSObject>]
[-Begin <ScriptBlock>]
[-Process] <ScriptBlock[]>
[-End <ScriptBlock>]
[-RemainingScripts <ScriptBlock[]>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]