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

PI Powershell

SetAFCategory Class

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

Set an AF Category

The Set-AFCategory cmdlet edits an existing AF Category. The category can be an attribute, element, analysis, table or reference type category.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellSetAFCategory

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

Syntax

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

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

The SetAFCategory type exposes the following members.

Constructors

  NameDescription
Public method
SetAFCategory

Properties

  NameDescription
Public property
AFCategory

AF Category to edit

Public property
CheckIn

Check in changes immediately

Public property
Description

Description to set on the AF Category

Public property
NewName

NewName to set on the AF Category

Public property
PassThru

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

Examples

Set-AFCategory -NewName "Product A Manufacturing" -CheckIn -AFCategory $afCategory

Where:

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

$afCategory = Get-AFCategory -Name "New Category 1" -Element -AFDatabase $afDB

Renames an existing AF Element Category "New Category 1" to "Product A Manufacturing" on the AF Database "AFDatabase1" on AF Server "PIAF1". The change is checked in immediately.

Examples

Set-AFCategory -Description "KPIs for Product A Process" -CheckIn -AFCategory $afCategory

Where:

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

$afCategory = Get-AFCategory -Name "KPIs" -Element -AFDatabase $afDB

Adds a description to the existing AF Attribute Category "KPIs" on 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