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

PI Powershell

AddAFPort Class

  • Last UpdatedDec 15, 2025
  • 4 minute read
AddAFPort Class

Add an AF Port

The Add-AFPort cmdlet adds a new AF Port to an existing AF Element or AF Element Template

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellAddAFPort

Namespace:  OSIsoft.PowerShell
Assembly:  OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)

Syntax

[CmdletAttribute("Add", "AFPort", SupportsShouldProcess = true)]
public class AddAFPort : OSICmdletBase
<CmdletAttribute("Add", "AFPort", SupportsShouldProcess := true)>
Public Class AddAFPort
	Inherits OSICmdletBase

Dim instance As AddAFPort
[CmdletAttribute(L"Add", L"AFPort", SupportsShouldProcess = true)]
public ref class AddAFPort : public OSICmdletBase
[<CmdletAttribute("Add", "AFPort", SupportsShouldProcess = true)>]
type AddAFPort =  
    class
        inherit OSICmdletBase
    end

The AddAFPort type exposes the following members.

Constructors

  NameDescription
Public method
AddAFPort

Properties

  NameDescription
Public property
AFElement

AF Element to which to add the AF Port

Public property
AFElementTemplate

AF Element Template to which to add the AF Port

Public property
AFPortType

Type of AF Port to add

Public property
AllowedElementCategory

List of AF Element Categories for AF Elements which are allowed to connect to this port

Public property
AllowedElementTemplate

Only AF Elements using this AF Element Template are allowed to connect to this port

Public property
AllowedElementType

Types of AF Elements which are allowed to connect to this port

Public property
CheckIn

Check in changes immediately

Public property
Description

Description of the AF Port to add

Public property
IsDefault

Add the AF Port as the default AF Port

Public property
MaxConnections

Maximum number of connections to allow on the AF Port to add

Public property
Name

Name of the AF Port to add

Examples

Add-AFPort -Name InputPort1 -AFPortType Input -AFElementTemplate $afElementTemplate -CheckIn

Where:

$afDB = Get-AFDatabase "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1")

$afElementTemplate = Get-AFElementTemplate -Name Boiler -AFDatabase $afDB

This example will create a new AF Port on the Boiler AF Element Template. The port will be an Input port, and the change is checked in immediately.

Examples

Add-AFPort -Name UndirectedPort1 -AFPortType Undirected -MaxConnections 5 -AFElement $afElement -CheckIn

Where:

$afDB = Get-AFDatabase "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1")

$afElement = Get-AFElement -Name WestSite -AFDatabase $afDB

This example will create a new AF Port on the WestSite top level AF Element. It will be undirected, restrict the number of connections to 5, and the change will be checked in immediately.

See Also

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