foreach

The foreach loop executes against each element of a collection using the following notation:

foreach (<element> in <collection>) { 
    <body-statements> 
} 

For example, the foreach loop may be used to iterate through each of the processes returned by Get-Process:

foreach ($process in Get-Process) { 
    Write-Host $process.Name 
}

If the collection is $null or empty, the body of the loop will not execute.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.168.172