ForEach-Object


Applies script blocks to each object in the pipeline.

Snap-In: Microsoft.PowerShell.Core

Syntax:

ForEach-Object

 [-Process] <ScriptBlock[]> [-InputObject <PSObject>] [-Begin <ScriptBlock>] [-End <ScriptBlock>] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] 

Description:

This ForEach-Object Cmdlet allows you to process the set of objects passing through the pipeline by applying a script block argument to each item. The result of the evaluation of the script block is passed down the pipe. The script block can contain any arbitrary Ps script elements. It is executed in the current context and the value of the current pipeline object is available in the $_ variable. You can also specify -begin and -end actions. The -begin parameter specifies that the script block is to be executed before the first object is processed. The -end parameter specifies that the script block is to be executed after the last object has been processed. Any objects produced by either -begin or -end a re also added to the output.



Windows PowerShell. TFM
Internet Forensics
ISBN: 982131445
EAN: 2147483647
Year: 2004
Pages: 289

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net