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

PI Powershell

AddAFUnitOfMeasureClass Class

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

Add an AF Unit of Measure Class

The Add-AFUnitOfMeasureClass cmdlet will create a new AF Unit of Measure Class on an AF Server.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellAddAFUnitOfMeasureClass

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

Syntax

[CmdletAttribute("Add", "AFUnitOfMeasureClass", DefaultParameterSetName = "FactorOffset", 
	SupportsShouldProcess = true)]
public class AddAFUnitOfMeasureClass : OSICmdletBase
<CmdletAttribute("Add", "AFUnitOfMeasureClass", DefaultParameterSetName := "FactorOffset", 
	SupportsShouldProcess := true)>
Public Class AddAFUnitOfMeasureClass
	Inherits OSICmdletBase

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

The AddAFUnitOfMeasureClass type exposes the following members.

Constructors

  NameDescription
Public method
AddAFUnitOfMeasureClass

Properties

  NameDescription
Public property
AFServer

AF Server for which to add the AF Unit of Measure Class

Public property
BaseUnitOfMeasureClass

List of the Unit of Measure Classes that represent the base Unit of Measure on which this Class is based

Public property
BaseUnitOfMeasurePower

Power for each the base Unit of Measure base class to add

If there is more than 1 base Unit of Measure Class, the powers can be passed as an array.

Public property
CanonicalAbbreviation

Abbreviated name for the canonical unit of measure for the AF Unit of Measure class to be added. The abbreviation must be unique within the Unit of Measure's collection or the same as the CanonicalUnitOfMeasureName parameter.

If not specified, the abbreviation defaults to the same as the CanonicalUnitOfMeasureName.

Public property
CanonicalUnitOfMeasureName

Name of the Canonical Unit of Measure for the class to be added. If the name ends with an "*" then a unique name will be generated based on the supplied name.

Public property
CheckIn

Check in changes immediately

Public property
Description

Description for the AF Unit of Measure Class to add

Public property
Name

Name of the AF Unit of Measure Class to add

Examples

Add-UnitOfMeasureClass -Name "MyUOMClass" -CanonicalAbbreviation "MU" -CanonicalUnit "MyUnit" -CheckIn -AFServer $afServer

Where:

$afServer = Get-AFServer -Name PIAF1

This example creates a new AF Unit of Measure Class on AF Server "PIAF1" called "MyUOMClass". The change is checked in immediately.

Examples

Add-AFUnitOfMeasureClass -Name Force -CanonicalUnitOfMeasureName "newton" CanonicalAbbreviation "N" -BaseUnitOfMeasureClass @($length,$time,$mass) -BaseUnitOfMeasurePower @(1,-2,1) -CheckIn -AFServer $afServer

Where:

$afServer = Get-AFServer -Name PIAF1

$length = Get-AFUnitOfMeasureClass -Name Length -AFServer $afServer

$time = Get-AFUnitOfMeasureClass -Name Time -AFServer $afServer

$mass = Get-AFUnitOfMeasureClass -Name Mass -AFServer $afServer

This example would create the AF Unit of Measure "Force" on the AF Server "PIAF1". This example is shown for illustrative purposes only and should not be used as is because the "Force" Unit of Measure class exists by default on the AF Server.

See Also

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