SetAFElement Class
- Last UpdatedDec 15, 2025
- 3 minute read
Set an AF Element
The Set-AFElement cmdlet edits an existing AF Element.
Inheritance Hierarchy
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
| Name | Description | |
|---|---|---|
| SetAFElement |
Properties
| Name | Description | |
|---|---|---|
| AFCategories | AF Categories to apply to the AF Element Use Get-AFCategory to get the Categories to apply to the element | |
| AFElement | AF Element to edit | |
| CheckIn | Check in changes immediately | |
| DefaultAttribute | Default AF Attribute for the AF Element | |
| DefaultInputPort | Default Input Port | |
| DefaultOutputPort | Default Output Port | |
| DefaultUndirectedPort | Default Undirected Port | |
| Description | Description to set on the AF Element | |
| ExtendedProperties | Extended properties to set on the AF Element | |
| NewName | New name to set on the AF Element | |
| PassThru | Returns objects that were changed. By default, this cmdlet does not generate any output |
Examples
Set-AFElement -NewName "Boiler Set 1" -AFElement $afElement -CheckInWhere:
$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.