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

PI Powershell

AddAFDatabase Class

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

Add an AF Database

The Add-AFDatabase cmdlet will add a new AF Database to a specified AF Server.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellAddAFDatabase

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

Syntax

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

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

The AddAFDatabase type exposes the following members.

Constructors

  NameDescription
Public method
AddAFDatabase

Properties

  NameDescription
Public property
AFServer

AFServer object representing the AF Server on which to add the database

Public property
Default

Make the AF Database to be added the default database

Public property
DefaultPIServerName

Specify the name of the default PI Server to be associated with this database

Public property
Description

Description for the AF Database to add to the specified AF Server

Public property
Name

Name of the AF Database to add to the specified AF Server

Examples

Add-AFDatabase -Name MyNewDB -AFServer (Get-AFServer -Default)

This example will add a new AF Database to the default AF Server in the local AF Servers list.

Examples

Add-AFDatabase -Name MyNewDB -AFServer (Get-AFServer -Name "PIAF1")

This example will add the AF Database "MyNewDB" to the AF Server "PIAF1".

Examples

Add-AFDatabase -Name MyNewDB -Description "New Corporate AF Database" -Default -AFServer -DefaultPIServerName "DEFPISERV" (Get-AFServer -Name "PIAF1")

This example will add an AF Database called "MyNewDB" to the AF Server "PIAF1" with a description and specified default PI Server and the new AF Database will be set as the default database.

See Also

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