In this post, we will look at how to loop through an array in PowerShell.
We can define our array as:
$myArray = “one”, “two”, “three”
And loop through it like below:
foreach ($arr in $myArray) {
Write-Output $arr
}
Running this, we get:


Keep learning. Keep building.
Explore AI, agents & Microsoft technology.
I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.
Subscribe on YouTube →Carl de Souza Enterprise Architect at Microsoft · AI Technology Expert