A instrução foreach e o Cmdlet Foreach-Object NÃO é a mesma coisa.
Por um:
In the case of the Foreach-Object, the statement body is executed as soon as each object is produced. In the foreach statement, all the objects are collected before the loop body begins to execute. This has two implications
Também há diferenças de desempenho e sintaxe.
$i = @(1..3) | ForEach-Object {Write-Host $_}
Funciona no Foreach-Object.