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

PI Powershell

SetAFUnitOfMeasure Class

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

Set an AF Unit of Measure

The Set-AFUnitOfMeasure cmdlet edits an existing AF Unit of Measure on an AF Server.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellSetAFUnitOfMeasure

Namespace:  OSIsoft.PowerShell
Assembly:  OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 2.2.3.0 (2.2.3.952)

Syntax

[CmdletAttribute("Set", "AFUnitOfMeasure", DefaultParameterSetName = "FactorOffset", 
	SupportsShouldProcess = true)]
public class SetAFUnitOfMeasure : OSICmdletBase
<CmdletAttribute("Set", "AFUnitOfMeasure", DefaultParameterSetName := "FactorOffset", 
	SupportsShouldProcess := true)>
Public Class SetAFUnitOfMeasure
	Inherits OSICmdletBase

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

The SetAFUnitOfMeasure type exposes the following members.

Constructors

  NameDescription
Public method
SetAFUnitOfMeasure

Properties

  NameDescription
Public property
Abbreviation

Abbreviation of the AF Unit of Measure to set. This can be an SI abbreviation or custom abbreviation

Public property
AFUnitOfMeasure

AF Unit of Measurement to set

Public property
CheckIn

Check in changes immediately

Public property
Description

Description of the AF Unit of Measure to set

Public property
FromFormula

Formula used to convert 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.

Public property
NewName

New name for the AF Unit of Measure to be set

Public property
PassThru

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

Public property
ReferenceFactor

Reference factor for the AF Unit of Measure to set

Public property
ReferenceOffset

Reference offset for the AF Unit of Measure to set

Public property
ReferenceUnitOfMeasure

Reference Unit of Measure used to define the UOM to set

Public property
ToFormula

Formula used to convert reference AF UOM to AF UOM to set

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

Set-AFUnitOfMeasure -Description "Decimeter is an SI unit of length representing 0.1 meters" -AFUnitOfMeasure $refUOM -CheckIn -AFServer $afServer

Where:

$afServer = Get-AFServer -Name PIAF1

$afUOM = Get-AFUnitOfMeasure -Name "decimeter" -AFServer $afServer

Edits the AF UOM "decimeter" by adding a description. The change is checked in immediately.

Examples

Set-AFUnitOfMeasure -NewName "decimetre" -AFUnitOfMeasure $afUOM -CheckIn -AFServer $afServer

Where:

$afServer = Get-AFServer -Name PIAF1

$refUOM = Get-AFUnitOfMeasure -Name "decimeter" -AFServer $afServer

Renames an existing AF UOM "decimeter" to "decimetre". The change is checked in immediately.

See Also

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