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

PI Powershell

SetAFElement Class

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

Set an AF Element

The Set-AFElement cmdlet edits an existing AF Element.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellSetAFElement

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

Syntax

[CmdletAttribute("Set", "AFElement", SupportsShouldProcess = true)]
public class SetAFElement : OSICmdletBase
<CmdletAttribute("Set", "AFElement", SupportsShouldProcess := true)>
Public Class SetAFElement
	Inherits OSICmdletBase

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

The SetAFElement type exposes the following members.

Constructors

  NameDescription
Public method
SetAFElement

Properties

  NameDescription
Public property
AFCategories

AF Categories to apply to the AF Element

Use Get-AFCategory to get the Categories to apply to the element

Public property
AFElement

AF Element to edit

Public property
CheckIn

Check in changes immediately

Public property
DefaultAttribute

Default AF Attribute for the AF Element

Public property
DefaultInputPort

Default Input Port

Public property
DefaultOutputPort

Default Output Port

Public property
DefaultUndirectedPort

Default Undirected Port

Public property
Description

Description to set on the AF Element

Public property
ExtendedProperties

Extended properties to set on the AF Element

Public property
NewName

New name to set on the AF Element

Public property
PassThru

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

Examples

Set-AFElement -NewName "Boiler Set 1" -AFElement $afElement -CheckIn

Where:

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

Renames the top level element "Production Line 1" to "Boiler Set 1" on the database "AFDatabase1" on the AF Server "PIAF1". The change will be checked in immediately.

Examples

Set-AFElement -Description "First Production Line" -AFCategories (Get-AFCategory -AFDatabase (Get-AFDatabase "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1")) -Name "MyCategory" -Element) -CheckIn -AFElement $afElement

Where:

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

Edits the top level AF Element "Production Line 1" on database "AFDatabase1" on AF Server "PIAF1" with a new description and sets the element category to an existing AF Category "MyCategory". The change is checked in immediately.

See Also

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