AddAFAttribute Class
- Last UpdatedDec 15, 2025
- 5 minute read
Add an AF Attribute
The Add-AFAttribute cmdlet creates a new AF Attribute. The attribute can be an attribute on an AF Element, or an AF Sub Attribute
Inheritance Hierarchy
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellAddAFAttribute
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)
Syntax
[CmdletAttribute("Add", "AFAttribute", SupportsShouldProcess = true)] public class AddAFAttribute : OSICmdletBase
<CmdletAttribute("Add", "AFAttribute", SupportsShouldProcess := true)> Public Class AddAFAttribute Inherits OSICmdletBase Dim instance As AddAFAttribute
[CmdletAttribute(L"Add", L"AFAttribute", SupportsShouldProcess = true)] public ref class AddAFAttribute : public OSICmdletBase
[<CmdletAttribute("Add", "AFAttribute", SupportsShouldProcess = true)>] type AddAFAttribute = class inherit OSICmdletBase end
The AddAFAttribute type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| AddAFAttribute |
Properties
| Name | Description | |
|---|---|---|
| AFAttribute | Parent AF Attribute on which to create the new sub AF Attribute | |
| AFElement | Parent AF Element on which to create the new AF Attribute | |
| CheckIn | Check in changes immediately | |
| DataReferencePluginName | Name of the data reference plugin to set on the new AF Attribute | |
| DataReferenceProperties | Properties of the data reference plugin to use for the Value of the AF Attribute | |
| DefaultUnitOfMeasure | Default unit of measure for the new AF Attribute | |
| Description | Description of the new AF Attribute to set | |
| IsConfigurationItem | Set the new AF Attribute as a configuration item | |
| IsExcluded | Set the new AF Attribute as excluded for the associated AF Element | |
| IsHidden | Set the new AF Attribute as hidden to client applications | |
| Name | Name of the new AF Attribute to set | |
| Type | Type to coerce value into | |
| Value | Value of the new AF Attribute to set |
Examples
Add-AFAttribute -Name "Interior Temperature" -Description "Interior temperature in celsius for Anneal Oven 1" -CheckIn -AFElement $afElement
Where:
$afElement = Get-AFElement -Name "Anneal Oven 1" -AFDatabase (Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1"))
Creates the AF Attribute "Interior Temperature" on the top level element "Anneal Oven 1" on the database "AFDatabase1" on the AF Server "PIAF1". A description is also added to the new attribute. The changes are immediately checked in.
Examples
Add-AFAttribute -Name "Interior Temperature" -DefaultUnitOfMeasure (Get-AFUnitOfMeasure -Name "degree celsius" -AFServer (Get-AFServer -Name "PIAF1")) -CheckIn -AFElement $afElement
Where:
$afElement = Get-AFElement -Name "Anneal Oven 1" -AFDatabase (Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1"))
Creates a new AF Attribute with name "Interior Temperature" and default unit of measure "degree celsius" on the top level element "Anneal Oven 1" on the database "AFDatabase1" on the AF Server "PIAF1". The changes are checked in immediately.
Examples
Add-AFAttribute -Name "Interior Temperature" -DefaultUnitOfMeasure (Get-AFUnitOfMeasure -Name "degree celsius" -AFServer (Get-AFServer -Name "PIAF1")) -DataReferencePluginName "PI Point" -CheckIn -AFElement $afElement
Where:
$afElement = Get-AFElement -Name "Anneal Oven 1" -AFDatabase (Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1"))
Creates a new AF Attribute with name "Interior Temperature" as a PI Point data reference and default UOM "degrees celsius" on the top level element "Anneal Oven 1" on the database "AFDatabase1" on the AF Server "PIAF1". The changes are checked in immediately.
Examples
Add-AFAttribute -Name "Temperature (F)" -DefaultUnitOfMeasure (Get-AFUnitOfMeasure -Name "degree fahrenheit" -AFServer (Get-AFServer -Name "PIAF1")) -DataReferencePluginName "PI Point" -CheckIn -AFAttribute $afAttribute
Where:
$afElement = Get-AFElement -Name "Anneal Oven 1" -AFDatabase (Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1"))
$afAttribute = Get-AFAttribute -Name "Interior Temperature" -AFElement $afElement
Creates a new sub AF Attribute with name "Temperature (F)" as a PI Point data reference and default UOM "degrees fahrenheit" on the top level element "Anneal Oven 1" on the database "AFDatabase1" on the AF Server "PIAF1". The changes are checked in immediately.