Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI Powershell

SetPIAFLinkTracing Class

  • Last UpdatedDec 15, 2025
  • 3 minute read
SetPIAFLinkTracing Class

Enable or disable PI AF Link tracing on a PI Data Archive

The Set-PIAFLinkTrace cmdlet will enable or disable PI AF Link tracing on a specified PI Data Archive. When enabling the trace, the trace timeout and separate logfile to write the results can also be specified.

The connection parameter specifies the connection to a PI Data Archive to use.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellSetPIAFLinkTracing

Namespace:  OSIsoft.PowerShell
Assembly:  OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 2.2.3.0 (2.2.3.952)

Syntax

[CmdletAttribute("Set", "PIAFLinkTracing", SupportsShouldProcess = true, 
	DefaultParameterSetName = "Disable tracing")]
public class SetPIAFLinkTracing : OSICmdletBase
<CmdletAttribute("Set", "PIAFLinkTracing", SupportsShouldProcess := true, 
	DefaultParameterSetName := "Disable tracing")>
Public Class SetPIAFLinkTracing
	Inherits OSICmdletBase

Dim instance As SetPIAFLinkTracing
[CmdletAttribute(L"Set", L"PIAFLinkTracing", SupportsShouldProcess = true, 
	DefaultParameterSetName = L"Disable tracing")]
public ref class SetPIAFLinkTracing : public OSICmdletBase
[<CmdletAttribute("Set", "PIAFLinkTracing", SupportsShouldProcess = true, 
	DefaultParameterSetName = "Disable tracing")>]
type SetPIAFLinkTracing =  
    class
        inherit OSICmdletBase
    end

The SetPIAFLinkTracing type exposes the following members.

Constructors

  NameDescription
Public method
SetPIAFLinkTracing

Properties

  NameDescription
Public property
Connection

Connection to a PI Data Archive to use

Public property
Disable

Manually disable the PI AF Link Trace

Public property
Enable

Enable a PI AF Link trace

Public property
LogFile

Log file to output the AF Link trace to. If not specified, messages will be written to the PI message log by default.

Public property
Timeout

Timeout at which the AF Link tracing will automatically be disabled. If not specified, the default value of 5 minutes ("00:05:00") is used.

Examples

Set-PIAFLinktrace -Enable -Connection $con

Where:

$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"

Enables PI AF Link tracing on the PISRV1 PI Data Archive. The Timeout and LogFile parameters are not specified, so defaults are used. I.E. The trace will timeout after 5 minutes (unless manually disabled - see next example) and messages will be written to the PI Message Log.

Examples

Set-PIAFLinktrace -Disable -Connection $con

Where:

$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"

This example will manually disable a PI AF Link Trace currently in progress.

Examples

Set-PIAFLinktrace -Enable -Timeout "00:10:00" -LogFile C:\Logs\aflinktrace.txt -Connection $con

Where:

$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"

This example will enable a PI AF Link Trace on the PISRV1 PI Data Archive that will timeout after 10 minutes, and where the messages will be written to C:\Logs\aflinktrace.txt rather than the PI Message Log.

See Also

TitleResults for “How to create a CRG?”Also Available in