Write Warning(String) Method
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Display warning information
public: void WriteWarning(System::String ^ text);
public: void WriteWarning(Platform::String ^ text);
void WriteWarning(std::wstring const & text);
public void WriteWarning (string text);
member this.WriteWarning : string -> unit
Public Sub WriteWarning (text As String)
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. WriteWarning may only be called during a call to this Cmdlet's implementation of ProcessRecord, BeginProcessing or EndProcessing, and only from that thread.
Use WriteWarning to display warnings about the activity of your Cmdlet. By default, warning output will be displayed, although this can be configured with the WarningPreference shell variable or the -Verbose and -Debug command-line options.