SetAFAttribute Class
- Last UpdatedDec 15, 2025
- 4 minute read
Sets an AF Attribute
The Set-AFAttribute cmdlet edits an existing AF Attribute.
Inheritance Hierarchy
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellSetAFAttribute
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)
Syntax
[CmdletAttribute("Set", "AFAttribute", DefaultParameterSetName = "Value", SupportsShouldProcess = true)] public class SetAFAttribute : OSICmdletBase
<CmdletAttribute("Set", "AFAttribute", DefaultParameterSetName := "Value", SupportsShouldProcess := true)> Public Class SetAFAttribute Inherits OSICmdletBase Dim instance As SetAFAttribute
[CmdletAttribute(L"Set", L"AFAttribute", DefaultParameterSetName = L"Value", SupportsShouldProcess = true)] public ref class SetAFAttribute : public OSICmdletBase
[<CmdletAttribute("Set", "AFAttribute", DefaultParameterSetName = "Value", SupportsShouldProcess = true)>] type SetAFAttribute = class inherit OSICmdletBase end
The SetAFAttribute type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| SetAFAttribute |
Properties
| Name | Description | |
|---|---|---|
| AFAttribute | AF Attribute to edit | |
| CheckIn | Check in changes immediately | |
| DataReferencePluginName | Name of the data reference plugin to set on the AF Attribute | |
| DataReferenceProperties | Properties of the data reference plugin to use for the Value of the AF Attribute | |
| DefaultUnitOfMeasure | Default unit of measure to set on the AF Attribute | |
| Description | Description of the AF Attribute to set | |
| IsConfigurationItem | Set the AF Attribute as a configuration item | |
| IsExcluded | Set the AF Attribute as excluded for the associated AF Element | |
| IsHidden | Set the AF Attribute as hidden to client applications | |
| NewName | New name of the AF Attribute to set | |
| PassThru | Returns objects that were changed. By default, this cmdlet does not generate any output. | |
| Type | Type to coerce value into | |
| Value | Value of AF Attribute to set |
Examples
Set-AFAttribute -NewName "Interior Temperature" -Description "Interior temperature in celsius for Anneal Oven 1" -CheckIn -AFAttribute $afAttribute
Where:
$afElement = Get-AFElement -Name "Anneal Oven 1" -AFDatabase (Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1"))
$afAttribute = Get-AFAttribute -Name "Inner Temperature" -AFElement $afElement
Edits the AF Attribute "Inner Temperature" on the top level element "Anneal Oven 1" on the database "AFDatabase1" on the AF Server "PIAF1". A new name is given to the attribute, as well as a new description. Changes are checked in immediately.
Examples
Set-AFAttribute -DefaultUnitOfMeasure (Get-AFUnitOfMeasure -Name "Degrees Celsius" -AFServer (Get-AFServer -Name "PIAF1")) -CheckIn -AFAttribute $afAttribute
Where:
$afElement = Get-AFElement -Name "Anneal Oven 1" -AFDatabase (Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1"))
$afAttribute = Get-AFAttribute -Name "Interior Temperature" -AFElement $afElement
Sets the default unit of measure to "Degrees Celsius" for the AF Attribute "Interior Temperature" on the top level element "Anneal Oven 1" on the database "AFDatabase1" on the AF Server "PIAF1". The changes are checked in immediately.
Examples
Set-AFAttribute -DataReferencePluginName "PI Point" -CheckIn -AFAttribute $afAttributeWhere:
$afElement = Get-AFElement -Name "Anneal Oven 1" -AFDatabase (Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1"))
$afAttribute = Get-AFAttribute -Name "Interior Temperature" -AFElement $afElement
Sets the AF Attribute as a PI Point data reference for the AF Attribute "Interior Temperature" on the top level element "Anneal Oven 1" on the database "AFDatabase1" on the AF Server "PIAF1". The changes are checked in immediately.