Using the example in variable assignment And you want to do something to each variable, you may do the following: 1foreach ($i in $container_ids) { 2$i 3} So for instance, you want to delete all the containers: 1foreach ($i in $container_ids) { 2docker rm $i 3}
Read MoreFrom powershell CLI; 1$container_ids=docker ps -qa 2$container_ids In the command above, 1st line does the assignment. 2nd line prints the values. You will then have an output such as the following: 16fc00bc6a 2ba3c76ca3 3a9b4e46eb
Read More