AddAFPort Class
- Last UpdatedDec 15, 2025
- 4 minute read
Add an AF Port
The Add-AFPort cmdlet adds a new AF Port to an existing AF Element or AF Element Template
Inheritance Hierarchy
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
| Name | Description | |
|---|---|---|
| AddAFPort |
Properties
| Name | Description | |
|---|---|---|
| AFElement | AF Element to which to add the AF Port | |
| AFElementTemplate | AF Element Template to which to add the AF Port | |
| AFPortType | Type of AF Port to add | |
| AllowedElementCategory | List of AF Element Categories for AF Elements which are allowed to connect to this port | |
| AllowedElementTemplate | Only AF Elements using this AF Element Template are allowed to connect to this port | |
| AllowedElementType | Types of AF Elements which are allowed to connect to this port | |
| CheckIn | Check in changes immediately | |
| Description | Description of the AF Port to add | |
| IsDefault | Add the AF Port as the default AF Port | |
| MaxConnections | Maximum number of connections to allow on the AF Port to add | |
| 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 -CheckInWhere:
$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.