SetAFAttributeTemplate Class
- Last UpdatedDec 15, 2025
- 4 minute read
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
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellSetAFAttributeTemplate
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)
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
| Name | Description | |
|---|---|---|
| SetAFAttributeTemplate |
Properties
| Name | Description | |
|---|---|---|
| AFAttributeTemplate | AF attribute template to edit | |
| CheckIn | Check in changes immediately | |
| DataReferencePluginName | Name of the data reference plugin to set on the AF Attribute Template | |
| DataReferenceProperties | Properties of the data reference plugin to use for the Value of the AF Attribute Template | |
| DefaultUnitOfMeasure | Default unit of measure to set on the AF Attribute Template | |
| Description | Description of the AF Attribute Template to set | |
| IsConfigurationItem | Set the AF Attribute Template as a configuration item | |
| IsExcluded | Set the AF Attribute Template as excluded for the associated AF Element Template | |
| IsHidden | Set the AF Attribute Template as hidden to client applications | |
| IsIndexed | Set the AF Attribute Template as indexed | |
| NewName | New name of the AF Attribute Template to set | |
| PassThru | Returns objects that were changed. By default, this cmdlet does not generate any output. | |
| Type | Type to coerce value into | |
| 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 $afAttTemplateWhere:
$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.