다음을 통해 공유


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.

public:
 void WriteInformation(System::Management::Automation::InformationRecord ^ informationRecord);
public void WriteInformation (System.Management.Automation.InformationRecord informationRecord);
member this.WriteInformation : System.Management.Automation.InformationRecord -> unit
Public Sub WriteInformation (informationRecord As 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

WriteInformation(Object, String[])

Route information to the user or host.

public:
 void WriteInformation(System::Object ^ messageData, cli::array <System::String ^> ^ tags);
public:
 void WriteInformation(Platform::Object ^ messageData, Platform::Array <Platform::String ^> ^ tags);
void WriteInformation(winrt::Windows::Foundation::IInspectable const & messageData, std::Array <std::wstring const &> const & tags);
public void WriteInformation (object messageData, string[] tags);
member this.WriteInformation : obj * string[] -> unit
Public Sub WriteInformation (messageData As Object, tags As String())

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