SetPIAFLinkTracing Class
- Last UpdatedDec 15, 2025
- 3 minute read
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
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellOSICmdletBaseWithConnection
OSIsoft.PowerShellSetPIAFLinkTracing
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)
Syntax
[CmdletAttribute("Set", "PIAFLinkTracing", SupportsShouldProcess = true, DefaultParameterSetName = "Disable tracing")] public class SetPIAFLinkTracing : OSICmdletBaseWithConnection
<CmdletAttribute("Set", "PIAFLinkTracing", SupportsShouldProcess := true, DefaultParameterSetName := "Disable tracing")> Public Class SetPIAFLinkTracing Inherits OSICmdletBaseWithConnection Dim instance As SetPIAFLinkTracing
[CmdletAttribute(L"Set", L"PIAFLinkTracing", SupportsShouldProcess = true, DefaultParameterSetName = L"Disable tracing")] public ref class SetPIAFLinkTracing : public OSICmdletBaseWithConnection
[<CmdletAttribute("Set", "PIAFLinkTracing", SupportsShouldProcess = true, DefaultParameterSetName = "Disable tracing")>] type SetPIAFLinkTracing = class inherit OSICmdletBaseWithConnection end
The SetPIAFLinkTracing type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| SetPIAFLinkTracing |
Properties
| Name | Description | |
|---|---|---|
| Connection | Connection to a PI Data Archive to use | |
| Disable | Manually disable the PI AF Link Trace | |
| Enable | Enable a PI AF Link trace | |
| LogFile | Log file to output the AF Link trace to. If not specified, messages will be written to the PI message log by default. | |
| 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 $conWhere:
$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.