SetAFElementTemplate Class
- Last UpdatedDec 15, 2025
- 4 minute read
Set an AF Element Template
The Set-AFElementTemplate cmdlet edits an existing AF Element Template.
Inheritance Hierarchy
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellSetAFElementTemplate
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 2.2.3.0 (2.2.3.952)
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
| Name | Description | |
|---|---|---|
| SetAFElementTemplate |
Properties
| Name | Description | |
|---|---|---|
| AFCategories | AF Categories to apply to the AF Element Template | |
| AFElementTemplate | AF Element Template to edit | |
| AFElementType | Element template type to set on the AF Element Template | |
| AllowExtensions | Set the AF Element Template to allow extensions | |
| BaseTemplate | Base template to set on the AF Element Template | |
| CheckIn | Check in immediately | |
| DefaultAttribute | Default attribute to set on the AF Element Template | |
| DefaultInputPort | Default input port for the AF Element Template | |
| DefaultOutputPort | Default output port for the AF Element Template | |
| DefaultUndirectedPort | Default undirected port for the AF Element Template | |
| Description | Description to set on the AF Element Template | |
| ExtendedProperties | Extended properties to set on the AF Element Template | |
| NamingPattern | Naming pattern to set on the AF Element Template | |
| NewName | New name of the AF Element Template | |
| PassThru | Returns objects that were changed. By default, this cmdlet does not generate any output |
Examples
Set-AFElementTemplate -NewName "Boiler" -AFElementTemplate $afEleTemplate -CheckInWhere:
$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 $afEleTemplateWhere:
$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.