GetAFElement Class
- Last UpdatedDec 15, 2025
- 3 minute read
Get an AF Element
The Get-AFElement cmdlet gets an AF Element. The element can be retrieved by name, ID, index, or by parent element.
Note that this cmdlet will only search the top level elements of the specified AF Database. Lower level elements can be accessed by then getting the child elements of the top level elements.
Inheritance Hierarchy
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellGetAFElement
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)
Syntax
[CmdletAttribute("Get", "AFElement", SupportsShouldProcess = true)] public class GetAFElement : OSICmdletBase
<CmdletAttribute("Get", "AFElement", SupportsShouldProcess := true)> Public Class GetAFElement Inherits OSICmdletBase Dim instance As GetAFElement
[CmdletAttribute(L"Get", L"AFElement", SupportsShouldProcess = true)] public ref class GetAFElement : public OSICmdletBase
[<CmdletAttribute("Get", "AFElement", SupportsShouldProcess = true)>] type GetAFElement = class inherit OSICmdletBase end
The GetAFElement type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| GetAFElement |
Properties
| Name | Description | |
|---|---|---|
| AFDatabase | AF Database containing AF Element | |
| AFElement | Parent AF Element for which to get child elements (1 level deep) | |
| ID | ID of the AF Element to get | |
| Index | Index of the AF Element to get | |
| Name | Name of the AF Element to get. Accepts wildcards. If element name is omitted, "*" will be used. | |
| Refresh | Refresh the container before accessing |
Examples
Get-AFElement -Name "Production Line 1" -AFDatabase $afDBWhere:
$afDB = Get-AFDatabase "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1")
Gets the top level element "Production Line 1" from the database "AFDatabase1" on the AF Server "PIAF1".
Examples
Get-AFElement -AFElement $afElement -Name "Boiler 1"Where:
$afElement = Get-AFElement -Name "Production Line 1" -AFDatabase (Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1"))
Gets the child element of "Production Line 1" called "Boiler1" from the database "AFDatabase1" on the AF Server "PIAF1".
Examples
Get-AFElement -Name * -AFDatabase $afDB
Where:
$afDB = Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1")
Gets all top level elements from the database "AFDatabase1" on the AF Server "PIAF1".