WarningRecord Class

Describes a warning message sent to the warning stream, plus information about the command that sent the message. This class is introduced in Windows PowerShell 2.0.


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

'Usage
Dim instance As WarningRecord

[DataContractAttribute] 
public ref class WarningRecord : public InformationalRecord
/** @attribute DataContractAttribute() */ 
public class WarningRecord extends InformationalRecord
DataContractAttribute 
public class WarningRecord extends InformationalRecord

When a command sends a message to the warning stream, the Windows PowerShell runtime creates the warning record that includes the original message plus information such as the name of the command, the string used to run the command, and the location of the command in the pipeline.

Warning messages are sent when a cmdlet calls the Cmdlet.WriteWarning method or a provider cmdlet calls the CmdletProvider.WriteWarning method.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

 

Target Platforms


Show:
© 2014 Microsoft