Running tasks parallel in powershell : <p>I have a PowerShell script like this:</p>

<pre><code>Foreach ($file in $files) {
    [Do something]
    [Do something]
    [Do something]
}
</code></pre>

<p>This way one file is treated after the other. I want to treat 4 files at the same time.</p>

<p>I know of the foreach -parallel loop, but that does the [do something] tasks in parallel. I basically want to run the whole foreach loop in parallel.</p>

<p>How can I achieve this in PowerShell?</p>
