ImportAFXml Class
- Last UpdatedDec 15, 2025
- 5 minute read
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
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellImportAFXml
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)
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
| Name | Description | |
|---|---|---|
| ImportAFXml |
Properties
| Name | Description | |
|---|---|---|
| AFAttributes | AF Attributes collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead. | |
| AFAttributeTemplates | AF Attribute Templates collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead. | |
| AFCategories | AF Categories collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead. | |
| AFDatabases | AF Databases collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead. | |
| AFElements | AF Elements collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead. | |
| AFElementTemplates | AF Element Templates collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead. | |
| AFEventFrames | AF Event Frames collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead. | |
| AFObject | Single AF Object to import into. If a collection (>1) objects is to be imported into, use the appropriate plural parameter. | |
| AFPorts | AF Ports collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead. | |
| AFSecurityIdentities | AF Security Identities collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead. | |
| AFSecurityMappings | AF Security Mappings collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead. | |
| 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. | |
| AFUnitOfMeasureClasses | AF Unit of Measure Classes collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead. | |
| AFUnitsOfMeasure | AF Units of Measure collections to import AF Objects to. To import to a single collection, use the AFObject parameter instead. | |
| File | File from which to import AF Objects | |
| ImportMode | Import mode which indicates which data to import, or type of import to perform. | |
| 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 AllowCreateImports 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.