Set-TraceSource


Sets or removes the specified options and trace listeners from the specified trace source instance(s).

Snap-In: Microsoft.PowerShell.Utility

Syntax:

Set-TraceSource

 [-Name] <String[]> [ [-Option] <PSTraceSourceOptions>] [-ListenerOption <TraceOptions>] [-FilePath <String>] [-Force] [-Debugger] [-PSHost] [-PassThru] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] 

Set-TraceSource

 [-Name] <String[]> [-RemoveListener <String[]>] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] 

Set-TraceSource

 [-Name] <String[]> [-RemoveFileListener <String[]>] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] 

Description:

The Set-TraceSource Cmdlet has two general categories of usefulness.

  1. Using Flags, you set what traceable entities the TraceSources selected are set to emit trace messages for. \ Examples are: constructor, error, method, property, event, executionFlow, data, errors, or all of these. The first five are specific areas; the next three are combinations of all the separate details specific to the general concept they name, and all sets all forms of tracing active.

  2. Using the listener settings, the output of tracing can be directed to files, console, a host, or a custom listener (derived from System. Diagnostics.TraceListener) designed to receive and analyze the trace output. The categories available can be listed using get-tracesource. Different flags may be set for different categories in order to tune tracing to the need at hand, and different listeners may be used for different categories.

 NOTE:  File and custom listeners are easy to specify by name in order to remove them. Console, Host, and Debug listeners are created by default with the name Console, Host, and Debug, respectively, so they can be removed by name as well, using the removeListener option. It is possible to locate any of these listeners and alter their name property so that you can create more than one Console, Host, or Debug listener. If this is done, the -RemoveListener option will be able to remove those listeners by the name they have been given.



Windows PowerShell. TFM
Internet Forensics
ISBN: 982131445
EAN: 2147483647
Year: 2004
Pages: 289

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net