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

PI Powershell

AddAFCategory Class

  • Last UpdatedDec 15, 2025
  • 3 minute read
AddAFCategory Class

Add an AF Category

The Add-AFCategory cmdlet creates a new AF Category. The category can be added as an attribute, element, analysis, table or reference type category.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellAddAFCategory

Namespace:  OSIsoft.PowerShell
Assembly:  OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)

Syntax

[CmdletAttribute("Add", "AFCategory", SupportsShouldProcess = true)]
public class AddAFCategory : OSICmdletBase
<CmdletAttribute("Add", "AFCategory", SupportsShouldProcess := true)>
Public Class AddAFCategory
	Inherits OSICmdletBase

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

The AddAFCategory type exposes the following members.

Constructors

  NameDescription
Public method
AddAFCategory

Properties

  NameDescription
Public property
AFDatabase

AF Database for which to add the AF Category

Public property
Analysis

Add as Analysis Category

Public property
Attribute

Add as Attribute Category

Public property
CheckIn

Check in changes immediately

Public property
Description

Description of the AF Category to add

Public property
Element

Add as Element Category

Public property
Name

Name of the AF Category to add

Public property
ReferenceType

Add as ReferenceType Category

Public property
Table

Add as Table Category

Examples

Add-AFCategory -Name "Product A Manufacturing" -Element -CheckIn -AFDatabase $afDB

Where:

$afDB = Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1")

Adds a new AF Element Category "Product A Manufacturing" to the AF Database "AFDatabase1" on AF Server "PIAF1". The change is checked in immediately.

Examples

Add-AFCategory -Name "KPIs" -Description "KPIs for Product A Process" -Attribute -CheckIn -AFDatabase $afDB

Where:

$afDB = Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1")

Adds a new AF Attribute Category "KPIs" with a description to the AF Database "AFDatabase1" on AF Server "PIAF1". The change is checked in immediately.

See Also

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