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

PI Powershell

AddAFElementTemplate Class

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

Add an AF Element Template

The Add-AFElementTemplate cmdlet adds a new AF Element Template.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellAddAFElementTemplate

Namespace:  OSIsoft.PowerShell
Assembly:  OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)

Syntax

[CmdletAttribute("Add", "AFElementTemplate", SupportsShouldProcess = true)]
public class AddAFElementTemplate : OSICmdletBase
<CmdletAttribute("Add", "AFElementTemplate", SupportsShouldProcess := true)>
Public Class AddAFElementTemplate
	Inherits OSICmdletBase

Dim instance As AddAFElementTemplate
[CmdletAttribute(L"Add", L"AFElementTemplate", SupportsShouldProcess = true)]
public ref class AddAFElementTemplate : public OSICmdletBase
[<CmdletAttribute("Add", "AFElementTemplate", SupportsShouldProcess = true)>]
type AddAFElementTemplate =  
    class
        inherit OSICmdletBase
    end

The AddAFElementTemplate type exposes the following members.

Constructors

  NameDescription
Public method
AddAFElementTemplate

Properties

  NameDescription
Public property
AFCategories

AF Categories to apply to the AF Element Template to create

Public property
AFDatabase

AF Database on which to create the AF Element Template

Public property
AFElementType

Element template type of the AF Element Template to create

Public property
AllowExtensions

Allow extensions on the AF Element Template to create

Public property
BaseTemplate

Base template of the AF Element Template to create

Public property
CheckIn

Check in immediately

Public property
Description

Description of the AF Element Template to create

Public property
ExtendedProperties

Extended properties of the AF Element Template to create

Public property
Name

Name of the AF Element Template to create

Public property
NamingPattern

Naming pattern of the AF Element Template to create

Examples

Add-AFElementTemplate -Name "Boiler" -AFDatabase $afDB -CheckIn

Where:

$afDB = Get-AFDatabase "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1")

Adds the element template "Boiler" to the database "AFDatabase1" on the AF Server "PIAF1". The change is checked in immediately.

Examples

Add-AFElementTemplate -Name "Boiler" -Description "Template for all Boilers" -AFDatabase $afDB

Where:

$afDB = Get-AFDatabase "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1")

Adds the Element Template of "Boiler" to the database "AFDatabase1" on the AF Server "PIAF1" with an added description. The change is checked in immediately.

Examples

Add-AFElementTemplate -Name "Boiler" -Description "Template for all Boilers" -AFCategories (Get-AFCategory -AFDatabase $afDB -Name "Boiler" -Element) -AFDatabase $afDB

Where:

$afDB = Get-AFDatabase "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1")

Adds the Element Template of "Boiler" to the database "AFDatabase1" on the AF Server "PIAF1" with an added description. The change is checked in immediately. A description is added to the element template as well as adding the existing AF Category "Boilers" to the template.

See Also

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