Cmdlet.WriteInformation Method

Definition

Overloads

WriteInformation(InformationRecord)

Route information to the user or host.

WriteInformation(Object, String[])

Route information to the user or host.

WriteInformation(InformationRecord)

Route information to the user or host.

C++
public:
 void WriteInformation(System::Management::Automation::InformationRecord ^ informationRecord);

Parameters

informationRecord
InformationRecord

The information record to write.

Exceptions

The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc.

Not permitted at this time or from this thread. WriteInformation may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread.

Remarks

Use WriteInformation to transmit information to the user about the activity of your Cmdlet. By default, informational output will be displayed, although this can be configured with the InformationPreference shell variable or the -InformationPreference command-line option.

Applies to

PowerShell SDK 7.4.0 e outras versións
Produto Versións
PowerShell SDK 7.2.0, 7.3.0, 7.4.0
Windows PowerShell 5.1.0.0

WriteInformation(Object, String[])

Route information to the user or host.

C++
public:
 void WriteInformation(System::Object ^ messageData, cli::array <System::String ^> ^ tags);

Parameters

messageData
Object

The object / message data to transmit to the hosting application.

tags
String[]

Any tags to be associated with the message data. These can later be used to filter or separate objects being sent to the host.

Exceptions

The pipeline has already been terminated, or was terminated during the execution of this method. The Cmdlet should generally just allow PipelineStoppedException to percolate up to the caller of ProcessRecord etc.

Not permitted at this time or from this thread. WriteInformation may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread.

Remarks

Use WriteInformation to transmit information to the user about the activity of your Cmdlet. By default, informational output will be displayed, although this can be configured with the InformationPreference shell variable or the -InformationPreference command-line option.

Applies to

PowerShell SDK 7.4.0 e outras versións
Produto Versións
PowerShell SDK 7.2.0, 7.3.0, 7.4.0
Windows PowerShell 5.1.0.0