In most cases, if you want to iterate all the values in an array, consider using a Foreach statement.
En la mayoría de los casos, si desea recorrer en iteración todos los valores de una matriz, puede ser más conveniente usar una instrucción Foreach.
The entire Foreach statement does not have to appear on a single line if you place the command in a.ps1 script file instead.
En cambio, la instrucción Foreach completa no tiene que aparecer en una única línea si el comando se incluye en un archivo de script.ps1.
These collections are accessed through the instance properties Variables and Constants, through which we can enumerate them using a foreach statement.
A estas colecciones se accede a través de las propiedades de instancia Variables y Constants, mediante las cuales podremos enumerarlas usando una instrucción foreach.
The block following a Foreach statement {<statement list>} contains a set of commands to execute against each item in a collection.
El bloque que sigue a la instrucción Foreach {<lista de instrucciones>} contiene una colección de comandos que se ejecutan respecto a cada elemento de una colección.
In addition, it is more flexible than the Foreach statement because you specify a conditional test in the While statement to control how many times the loop runs.
Además, es más flexible que la instrucción Foreach, ya que se especifica una prueba condicional en la instrucción While para controlar cuántas veces se ejecuta el bucle.
In the following example, the Foreach statement steps through the list of items that is returned by the Get-ChildItem cmdlet.
En el siguiente ejemplo, la instrucción Foreach recorre la lista de elementos devuelta por el cmdlet Get-ChildItem.
The ForEach statement selects only the Root property of the PSDriveInfo objects and combines it with the specified child path.
La instrucción ForEach selecciona solo la propiedad Root de los objetos PSDriveInfo y la combina con la ruta de acceso secundaria especificada.
The entire Foreach statement must appear on a single line to run it as a command at the Windows PowerShell command prompt.
La instrucción Foreach completa debe aparecer en una sola línea para que se ejecute como un comando en el símbolo del sistema de Windows PowerShell.
The second command uses a ForEach statement to invoke each command, send the results to Get-Member, and limit the results from Get-Member to members that have the name "MachineName."
El segundo comando usa una instrucción ForEach para invocar cada comando, enviar los resultados a Get-Member y limitar los resultados de Get-Member a los miembros que tengan el nombre "MachineName".
The Foreach Statement Inside a Command Pipeline When Foreach appears in a command pipeline, Windows PowerShell uses the foreach alias, which calls the ForEach-Object command.
Instrucción Foreach dentro de una canalización de comando Cuando Foreach aparece en una canalización de comandos, Windows PowerShell utiliza el alias de foreach, que llama al comando ForEach-Object.
The foreach statement can iterate over any collection.
The exact details of the foreach statement will be described in greater depth shortly; what's important is the impact this short script can have on your web site.
Los detalles exactos de la sentencia foreach serán descritos en profundidad próximamente; lo que es importante es el impacto que este pequeño script pueda tener en su sitio.
It serves nothing to paraphrase the names of its variables and functions, nor the PHP functions described in its manual: comments such as loop through the table of values before a foreach statement only serve to uselessly increase the size of the files.
No sirve de nada citar el nombre de las variables y las funciones, ni las funciones de PHP descritas en el manual: los comentarios como iterando el vector de valores delante de un foreach no hace más que agrandar innecesariamente el tamaño de los archivos.