PowerShell Working with the PowerShell pipeline Working concept of pipeline


In a pipeline series each function runs parallel to the others, like parallel threads. The first processed object is transmitted to the next pipeline and the next processing is immediately executed in another thread. This explains the high speed gain compared to the standard ForEach

@( bigFile_1, bigFile_2, ..., bigFile_n) | Copy-File | Encrypt-File | Get-Md5
  1. step - copy the first file (in Copy-file Thread)
  2. step - copy second file (in Copy-file Thread) and simultaneously Encrypt the first (in Encrypt-File)
  3. step - copy third file (in Copy-file Thread) and simultaneously encrypt second file (in Encrypt-File) and simultaneously get-Md5 of the first (in Get-Md5)