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

PI Powershell

RemoveAFElement Class

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

Remove an AF Element

The Remove-AFElement cmdlet deletes an existing AF Element.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellRemoveAFElement

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

Syntax

[CmdletAttribute("Remove", "AFElement", DefaultParameterSetName = "Element", 
	SupportsShouldProcess = true)]
public class RemoveAFElement : OSICmdletBase
<CmdletAttribute("Remove", "AFElement", DefaultParameterSetName := "Element", 
	SupportsShouldProcess := true)>
Public Class RemoveAFElement
	Inherits OSICmdletBase

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

The RemoveAFElement type exposes the following members.

Constructors

  NameDescription
Public method
RemoveAFElement

Properties

  NameDescription
Public property
AFDatabase

The AF Database from which to remove the AF Element

Public property
AFElement

The AF Element or parent of AF Element to remove.

Public property
CheckIn

Check in immediately

Public property
DeleteAllReferences

Remove all references of the AF Element

Public property
ID

The ID of the AF Element to remove

Public property
Name

Name of the AF Element to remove

Examples

Remove-AFElement -AFElement $afElement -CheckIn

Where:

$afElement = Get-AFElement -Name "Production Line 1" -AFDatabase (Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1"))

Removes the element "Production Line 1" on the database "AFDatabase1" on the AF Server "PIAF1". The change will be checked in immediately.

Examples

Remove-AFElement -Name "Boiler 1" -AFDatabase $afDatabase

Where:

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

Removes the top level element "Boiler 1" from the database "AFDatabase1" on the AF Server "PIAF1".

See Also

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