Powershell loops

From wikinotes

for loops

$array = 'a','b','c'
ForEach ($item in $array){
    # do stuff
}
foreach ($dir in (get-childitem -recurse -path . -filter "package.py)) {
    cd $dir.DirectoryName;
    rez-build -i;
}


foreach ($dir in (get-children -recurse -directory -filter "python")){
    if (!(get-childitem -recurse -path $dir -filter *.py)){
        echo $dir.directoryname
    }
}