AddAFUnitOfMeasure Class
- Last UpdatedDec 15, 2025
- 4 minute read
Add an AF Unit of Measure
The Add-AFUnitOfMeasure cmdlet creates a new AF Unit of Measure on an AF Server.
Inheritance Hierarchy
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellAddAFUnitOfMeasure
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)
Syntax
[CmdletAttribute("Add", "AFUnitOfMeasure", DefaultParameterSetName = "FactorOffset", SupportsShouldProcess = true)] public class AddAFUnitOfMeasure : OSICmdletBase
<CmdletAttribute("Add", "AFUnitOfMeasure", DefaultParameterSetName := "FactorOffset", SupportsShouldProcess := true)> Public Class AddAFUnitOfMeasure Inherits OSICmdletBase Dim instance As AddAFUnitOfMeasure
[CmdletAttribute(L"Add", L"AFUnitOfMeasure", DefaultParameterSetName = L"FactorOffset", SupportsShouldProcess = true)] public ref class AddAFUnitOfMeasure : public OSICmdletBase
[<CmdletAttribute("Add", "AFUnitOfMeasure", DefaultParameterSetName = "FactorOffset", SupportsShouldProcess = true)>] type AddAFUnitOfMeasure = class inherit OSICmdletBase end
The AddAFUnitOfMeasure type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| AddAFUnitOfMeasure |
Properties
| Name | Description | |
|---|---|---|
| Abbreviation | Abbreviation of the AF Unit of Measure to add. This can be an SI abbrevation or custom abbreviation | |
| AFServer | AF Server for which to add the AF Unit of Measure | |
| CheckIn | Check in changes immediately | |
| Description | Description of the AF Unit of Measure to add | |
| FromFormula | Formula used to convert new AF UOM to reference UOM Note that formula UOMs have limitations as well as a performance impact. Simply UOMs with reference factors and reference offsets should be used instead whenever possible. | |
| Name | Name of the AF Unit of Measure to add | |
| ReferenceFactor | Reference factor for the AF Unit of Measure to add | |
| ReferenceOffset | Reference offset for the AF Unit of Measure to add | |
| ReferenceUnitOfMeasure | Reference Unit of Measure used to define the UOM to add | |
| ToFormula | Formula used to convert reference AF UOM to AF UOM to add Note that formula UOMs have limitations as well as performance impact. Simple UOMs with reference factors and reference offsets should be used instead whenever possible. |
Examples
Add-AFUnitOfMeasure -Name "decimeter" -Abbreviation "dm" -ReferenceUnitOfMeasure $refUOM -ReferenceFactor 0.1 -ReferenceOffset 0 -CheckIn -AFServer $afServer
Where:
$afServer = Get-AFServer -Name PIAF1
$refUOM = Get-AFUnitOfMeasure -Name "meter" -AFServer $afServer
Creates a new AF UOM "decimeter" using a reference factor and reference offset. A decimeter is equal to 0.1 meters, with SI abbreviation "dm". The change is checked in immediately.
Examples
Add-AFUnitOfMeasure -Name "decimeter" -Abbreviation "dm" -ReferenceUnitOfMeasure $refUOM -ToFormula "dm = m * 10" -FromFormula "m = dm / 10" -CheckIn -AFServer $afServer
Where:
$afServer = Get-AFServer -Name PIAF1
$refUOM = Get-AFUnitOfMeasure -Name "meter" -AFServer $afServer
Creates a new AF UOM "decimeter", using toformula and fromformula. A decimeter is equal to 0.1 meters, with SI abbreviation "dm". The change is checked in immediately.
Note that formula UOMs have limitations and also performance impacts and reference offset/factor UOMs should be used whenever possible. This is example is provided for demonstration purposes only, and a "decimeter" AF UOM should be created as shown in the first example.