<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>array on IT Quicktasks</title><link>https://quicktasks.ismael.casimpan.com/tags/array/</link><description>Recent content in array on IT Quicktasks</description><generator>Hugo -- gohugo.io</generator><copyright>Copyright © 2018–2022, Ismael Casimpan Jr.; All Rights Reserved</copyright><lastBuildDate>Sat, 03 Jul 2021 00:56:25 +0800</lastBuildDate><atom:link href="https://quicktasks.ismael.casimpan.com/tags/array/index.xml" rel="self" type="application/rss+xml"/><item><title>Processing each powershell array value</title><link>https://quicktasks.ismael.casimpan.com/post/processing-each-powershell-array-value/</link><pubDate>Sat, 03 Jul 2021 00:56:25 +0800</pubDate><guid>https://quicktasks.ismael.casimpan.com/post/processing-each-powershell-array-value/</guid><description>
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}</description></item><item><title>Assign Command Output to Powershell Array</title><link>https://quicktasks.ismael.casimpan.com/post/assign-command-output-to-powershell-array/</link><pubDate>Sat, 03 Jul 2021 00:55:25 +0800</pubDate><guid>https://quicktasks.ismael.casimpan.com/post/assign-command-output-to-powershell-array/</guid><description>
From 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</description></item></channel></rss>