A question about the pipleline and foreach
Say I have the below 2 patterns of PowerShell pipeline syntax:
cmdlet1 | cmdlet2 cmdlet1 | foreach {cmdlet2}
For example, with get-content import-csv we use foreach cmdlet but with get-aduser and set-aduser we do not. My question is what is the science here that distinguishes the 2 usage patterns.
Hope my question makes sense.
Thanks in advance