The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Cmdlet::ProcessRecord Method ()


Updated: April 27, 2016

Applies To: Windows PowerShell

Provides a record-by-record processing functionality for the cmdlet.

Namespace:   System.Management.Automation
Assembly:  System.Management.Automation (in System.Management.Automation.dll)

virtual void ProcessRecord()

Exception Condition

The override of this method can throw any exception that is required.

This method must be overridden in any cmdlet that does more than preprocessing or post-processing. The Windows PowerShell runtime calls this method multiple times for each instance of the cmdlet in the pipeline.

The override of this method does not have to be reentrant; this method does not have to be callable simultaneously with the BeginProcessing method or the EndProcessing method. None of these input processing methods are called if any one of them is running for a cmdlet instance. However, there is no guarantee that all calls to these methods will occur on the same thread.

This method must be overridden if a cmdlet parameter is defined as accepting ValueFromPipeline or ValueFromPipelineByPropertyName. If this method is not overridden, the cmdlet will not receive the pipelined values that are passed to the cmdlet. For more information about defining parameters, see ParameterAttribute Declaration.

For more information about when the Windows PowerShell runtime calls this method, see Cmdlet Lifecycle.

For more information about cmdlets, see Windows PowerShell Cmdlets.

Return to top

Community Additions