powerhell loop throught variable code example
Example 1: foreach loop powershell
foreach ($item in $items) {
## Do something to each item
}
Example 2: foreach powershell
ForEach($user in $users){
Write-Output $user
}
foreach ($item in $items) {
## Do something to each item
}
ForEach($user in $users){
Write-Output $user
}