Search notes:
PowerShell cmdLet Foreach-Object
Execute a script block in a pipeline
The
forEach-object
cmdLet
can be used to invoke a
script block
within a
pipeline
.
1 .. 10 | forEach-object { $_ * $_ }
Github repository
about-PowerShell
, path:
/cmdlets/object/forEach/script-block.ps1
Shorter ways to write forEach-object
forEach-object
can be abbreviated with
forEach
or
%
.
It should be noted, however, that
foreach
is also a
statement
and that the percent sign also acts as the arithmetic modulus
operator
.
Experimental feature PSForEachObjectParallel
In PowerShell Core, there is the
experimental feature
PSForEachObjectParallel
to run
script blocks
in parallel
See also
Powershell command noun: object
Common first class function: map
Index