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

PI Powershell

SetAFElementTemplate Class

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

Set an AF Element Template

The Set-AFElementTemplate cmdlet edits an existing AF Element Template.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellSetAFElementTemplate

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

Syntax

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

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

The SetAFElementTemplate type exposes the following members.

Constructors

  NameDescription
Public method
SetAFElementTemplate

Properties

  NameDescription
Public property
AFCategories

AF Categories to apply to the AF Element Template

Public property
AFElementTemplate

AF Element Template to edit

Public property
AFElementType

Element template type to set on the AF Element Template

Public property
AllowExtensions

Set the AF Element Template to allow extensions

Public property
BaseTemplate

Base template to set on the AF Element Template

Public property
CheckIn

Check in immediately

Public property
DefaultAttribute

Default attribute to set on the AF Element Template

Public property
DefaultInputPort

Default input port for the AF Element Template

Public property
DefaultOutputPort

Default output port for the AF Element Template

Public property
DefaultUndirectedPort

Default undirected port for the AF Element Template

Public property
Description

Description to set on the AF Element Template

Public property
ExtendedProperties

Extended properties to set on the AF Element Template

Public property
NamingPattern

Naming pattern to set on the AF Element Template

Public property
NewName

New name of the AF Element Template

Public property
PassThru

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

Examples

Set-AFElementTemplate -NewName "Boiler" -AFElementTemplate $afEleTemplate -CheckIn

Where:

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

$afEleTemplate = Get-AFElementTemplate -Name MyEleTemplate -AFDatabase $afDB

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

Examples

Set-AFElementTemplate -Description "Template for all Boilers" -AllowExtensions $true -CheckIn -AFElementTemplate $afEleTemplate

Where:

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

$afEleTemplate = Get-AFElementTemplate -Name Boiler -AFDatabase $afDB

Sets the description for element template "Boiler" on the database "AFDatabase1" on the AF Server "PIAF1". The change is checked in immediately and the template is set to allow extensions.

Examples

Set-AFElementTemplate -AFCategories (Get-AFCategory -AFDatabase $afDB -Name "Boiler" -Element) -AFElementTemplate $afEleTemplate

Where:

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

$afEleTemplate = Get-AFElementTemplate -Name Boiler -AFDatabase $afDB

Assigns the element template of "Boiler" on the database "AFDatabase1" on the AF Server "PIAF1" to have the AF element category "Boiler". The change is checked in immediately.

See Also

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