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

PI Powershell

SetAFPort Class

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

Set an AF Port

The Set-AFPort cmdlet edits an existing AF Port on an AF Element or AF Element Template

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellSetAFPort

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

Syntax

[CmdletAttribute("Set", "AFPort", DefaultParameterSetName = "Name", 
	SupportsShouldProcess = true)]
public class SetAFPort : OSICmdletBase
<CmdletAttribute("Set", "AFPort", DefaultParameterSetName := "Name", 
	SupportsShouldProcess := true)>
Public Class SetAFPort
	Inherits OSICmdletBase

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

The SetAFPort type exposes the following members.

Constructors

  NameDescription
Public method
SetAFPort

Properties

  NameDescription
Public property
AFPort

AF Port to edit

Public property
AFPortType

AF Port Type to set on the AF Port

Public property
AllowedElementCategory

List of AF Element Categories for AF Elements that 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 that are allowed to connect to this port

Public property
CheckIn

Check in changes immediately

Public property
Description

Description to set on the AF Port

Public property
MaxConnections

Maximum number of connections to set on the AF Port

Public property
NewName

New name to set on the AF Port

Public property
PassThru

Returns objects that were changed. By default, this cmdlet does not generate any output.

Examples

Set-AFPort -Description "Input port for Boiler template" -MaxConnections 10 -AFPort $MyAFPort

Where:

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

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

$MyAFPort = Get-AFPort -Name InputPort1 -AFElementTemplate $afElementTemplate

Edits the AF Port InputPort1 from the Boiler element template on the AF Database AFDatabase1 with an updated description and max number of connections allowed.

See Also

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