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

PI Powershell

ImportAFXml Class

  • Last UpdatedDec 15, 2025
  • 5 minute read
ImportAFXml Class

Import XML representation of AF Objects from file or System.IO.Stream

The Import-AFXml cmdlet imports the XML representation of an AF object or AF objects from a file or System.IO.Stream.

If the objects are to be imported to a single AF Object, use the -AFObject to specify the target. If AF Objects are to be imported to multiple AF Collections, use the corresponding plural switch.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellImportAFXml

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

Syntax

[CmdletAttribute("Import", "AFXml", SupportsShouldProcess = true)]
public class ImportAFXml : OSICmdletBase
<CmdletAttribute("Import", "AFXml", SupportsShouldProcess := true)>
Public Class ImportAFXml
	Inherits OSICmdletBase

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

The ImportAFXml type exposes the following members.

Constructors

  NameDescription
Public method
ImportAFXml

Properties

  NameDescription
Public property
AFAttributes

AF Attributes collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead.

Public property
AFAttributeTemplates

AF Attribute Templates collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead.

Public property
AFCategories

AF Categories collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead.

Public property
AFDatabases

AF Databases collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead.

Public property
AFElements

AF Elements collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead.

Public property
AFElementTemplates

AF Element Templates collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead.

Public property
AFEventFrames

AF Event Frames collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead.

Public property
AFObject

Single AF Object to import into. If a collection (>1) objects is to be imported into, use the appropriate plural parameter.

Public property
AFPorts

AF Ports collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead.

Public property
AFSecurityIdentities

AF Security Identities collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead.

Public property
AFSecurityMappings

AF Security Mappings collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead.

Public property
AFServer

AF Server object to import AF Objects to. Note that the AF Server object only includes: AFContact, AFNotificationContactTemplate, and UOMDatabase objects. All other objects must be imported via the AF Database object or other collection.

Public property
AFUnitOfMeasureClasses

AF Unit of Measure Classes collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead.

Public property
AFUnitsOfMeasure

AF Units of Measure collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead.

Public property
File

File from which to import AF Objects

Public property
ImportMode

Import mode which indicates which data to import, or type of import to perform.

Public property
Stream

Stream from which to import AF Objects

Examples

Import-AFXml -File C:\MyAFElements.xml -AFObject (Get-AFDatabase -Name MyDatabase -AFServer (Get-AFServer -Name "PIAF1")) -ImportMode AllowCreate

Imports the AF Element objects in MyAFElements.xml into the AF Database "MyDatabase" on the PIAF1 AF Server. The AllowCreate option means that if the element is not found, it will be created.

See Also

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