powershell iterate over list of strings code example
Example 1: foreach powershell
ForEach($user in $users){
Write-Output $user
}
Example 2: powershell foreach
ForEach-Object
[-InputObject <PSObject>]
[-Begin <ScriptBlock>]
[-Process] <ScriptBlock[]>
[-End <ScriptBlock>]
[-RemainingScripts <ScriptBlock[]>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]