foreach -begin -process -end

gc d:vm.txt|foreach  -begin {write-host "It's beginning."}  -process {$_ +"aa"} -end {write-host "The end"}

原文地址:https://www.cnblogs.com/dreamer-fish/p/3804535.html