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

PI Powershell

SetAFAttributeTemplate Class

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

Sets an AF Attribute Template

The Set-AFAttributeTemplate cmdlet edits an existing 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.PowerShellSetAFAttributeTemplate

Namespace:  OSIsoft.PowerShell
Assembly:  OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 2.2.3.0 (2.2.3.952)

Syntax

[CmdletAttribute("Set", "AFAttributeTemplate", DefaultParameterSetName = "AttributeValue", 
	SupportsShouldProcess = true)]
public class SetAFAttributeTemplate : OSICmdletBase
<CmdletAttribute("Set", "AFAttributeTemplate", DefaultParameterSetName := "AttributeValue", 
	SupportsShouldProcess := true)>
Public Class SetAFAttributeTemplate
	Inherits OSICmdletBase

Dim instance As SetAFAttributeTemplate
[CmdletAttribute(L"Set", L"AFAttributeTemplate", DefaultParameterSetName = L"AttributeValue", 
	SupportsShouldProcess = true)]
public ref class SetAFAttributeTemplate : public OSICmdletBase
[<CmdletAttribute("Set", "AFAttributeTemplate", DefaultParameterSetName = "AttributeValue", 
	SupportsShouldProcess = true)>]
type SetAFAttributeTemplate =  
    class
        inherit OSICmdletBase
    end

The SetAFAttributeTemplate type exposes the following members.

Constructors

  NameDescription
Public method
SetAFAttributeTemplate

Properties

  NameDescription
Public property
AFAttributeTemplate

AF attribute template to edit

Public property
CheckIn

Check in changes immediately

Public property
DataReferencePluginName

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

Public property
DataReferenceProperties

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

Public property
DefaultUnitOfMeasure

Default unit of measure to set on the AF Attribute Template

Public property
Description

Description of the AF Attribute Template to set

Public property
IsConfigurationItem

Set the AF Attribute Template as a configuration item

Public property
IsExcluded

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

Public property
IsHidden

Set the AF Attribute Template as hidden to client applications

Public property
IsIndexed

Set the AF Attribute Template as indexed

Public property
NewName

New name of the AF Attribute Template to set

Public property
PassThru

Returns objects that were changed. By default, this cmdlet does not generate any output.

Public property
Type

Type to coerce value into

Public property
Value

Default value of AF Attribute Template to set

Examples

Set-AFAttributeTemplate -NewName "Interior Temperature" -Description "Interior temperature" -CheckIn -AFAttributeTemplate $afAttTemplate

Where:

$afEleTemplate = Get-AFElementTemplate -Name "Oven" -AFDatabase (Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1"))

$afAttTemplate = Get-AFAttributeTemplate -Name "My Attribute Template" -AFElement $afEleTemplate

Renames the AF Attribute Template "My Attribute Template" to "Interior Temperature" on the element template "Oven" on the database "AFDatabase1" on the AF Server "PIAF1". Changes are checked in immediately.

Examples

Set-AFAttributeTemplate -DefaultUnitOfMeasure (Get-AFUnitOfMeasure -Name "degree celsius" -AFServer (Get-AFServer -Name "PIAF1")) -CheckIn -AFAttributeTemplate $afAttAttribute

Where:

$afEleTemplate = Get-AFElementTemplate -Name "Oven" -AFDatabase (Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1"))

$afAttAttribute = Get-AFAttributeTemplate -Name "Interior Temperature" -AFElementTemplate $afEleTemplate

Sets the default unit of measure to "degree celsius" for the AF Attribute Template "Interior Temperature" on the element template "Oven" on the database "AFDatabase1" on the AF Server "PIAF1". The changes are checked in immediately.

Examples

Set-AFAttributeTemplate -DataReferencePluginName "PI Point" -CheckIn -AFAttributeTemplate $afAttTemplate

Where:

$afEleTemplate= Get-AFElementTemplate -Name "Oven" -AFDatabase (Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1"))

$afAttTemplate = Get-AFAttributeTemplate -Name "Interior Temperature" -AFElementTemplate $afEleTemplate

Sets 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