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