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

PI Powershell

RemoveAFPort Class

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

Remove an AF Port

The Remove-AFPort cmdlet removes an existing AF Port from an AF Element or AF Element Template

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellRemoveAFPort

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

Syntax

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

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

The RemoveAFPort type exposes the following members.

Constructors

  NameDescription
Public method
RemoveAFPort

Properties

  NameDescription
Public property
AFElement

AF Element from which to remove the AF Port

Public property
AFElementTemplate

AF Element Template from which to remove the AF Port

Public property
AFPort

AF Port to remove

Public property
CheckIn

Check in changes immediately

Public property
ID

GUID of the AF Port to remove

Public property
Name

Name of the AF Port to remove

Examples

Remove-AFPort -Name InputPort1 -AFElementTemplate $afElementTemplate -CheckIn

Where:

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

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

Removes the existing AF Port InputPort1 from the Boiler element template on the AF Database AFDatabase1. The change is checked in immediately.

Examples

Remove-AFPort -AFPort $MyAFPort -CheckIn

Where:

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

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

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

Removes the AF Port InputPort1 from the Boiler element template on the AF Database AFDatabase1.

See Also

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