AddAFDatabase Class
- Last UpdatedDec 15, 2025
- 3 minute read
Add an AF Database
The Add-AFDatabase cmdlet will add a new AF Database to a specified AF Server.
Inheritance Hierarchy
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
| Name | Description | |
|---|---|---|
| AddAFDatabase |
Properties
| Name | Description | |
|---|---|---|
| AFServer | AFServer object representing the AF Server on which to add the database | |
| Default | Make the AF Database to be added the default database | |
| DefaultPIServerName | Specify the name of the default PI Server to be associated with this database | |
| Description | Description for the AF Database to add to the specified AF Server | |
| 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.