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

PI Powershell

AddAFAttributeTemplate Class

  • Last UpdatedDec 15, 2025
  • 4 minute read
AddAFAttributeTemplate Class

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

SystemObject
  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

  NameDescription
Public method
AddAFAttributeTemplate

Properties

  NameDescription
Public property
AFAttributeTemplate

Parent AF Attribute Template under which to add the Sub Attribute Template

Public property
AFElementTemplate

AF Element Template under which to add the AF Attribute Template

Public property
CheckIn

Check in changes immediately

Public property
DataReferencePluginName

Name of the data reference plugin to set on the new AF Attribute Template

Public property
DataReferenceProperties

Properties of the data reference plugin to use for the Value of the new AF Attribute Template

Public property
DefaultUnitOfMeasure

Default unit of measure to set on the new AF Attribute Template

Public property
Description

Description of the AF Attribute Template to add

Public property
IsConfigurationItem

Add the AF Attribute Template as a configuration item

Public property
IsExcluded

Add the AF Attribute Template as excluded for the associated AF Element Template

Public property
IsHidden

Add the AF Attribute Template as hidden to client applications

Public property
IsIndexed

Add the AF Attribute Template as indexed

Public property
Name

Name of the AF Attribute Template to add

Public property
Type

Type to coerce value into

Public property
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.

See Also

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