Active IQ Unified Manager Discussions

Can WFA parse xml data ???

Sudeep
2,716 Views

Hi,

 

Can WFA parse and retrieve data from an XML file ?

if Yes how please provide assistance on how to do that ...

 

 

1 ACCEPTED SOLUTION

sinhaa
2,709 Views

WFA can do (almost) anything you can require from an automation framework.  Yes, It can parse XML file. XML support is available with both Perl and Powershell, but its way too powerful in a Powershell code and that's what I would recommend.

 

For powershell commands, you need to use the following in your command code.

 

$FilePath = "C:\mydir\my.xml"

[xml]$xmlDoc = New-Object system.Xml.XmlDocument
$xmlDoc.Load($FilePath)

 

or even simpler:

 

[xml]$xmldoc = Get-Content -Path C:\mydir\my.xml

 

Now you have an XML object with data contents with you. Do whatever you want to with it.

 

Examples? If you have WFA 3.0 you can look at WfaConfig.psm1 located at WFA\PoSH\Modules\WFAWrapper. 

 

 

sinhaa

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

2 REPLIES 2

sinhaa
2,710 Views

WFA can do (almost) anything you can require from an automation framework.  Yes, It can parse XML file. XML support is available with both Perl and Powershell, but its way too powerful in a Powershell code and that's what I would recommend.

 

For powershell commands, you need to use the following in your command code.

 

$FilePath = "C:\mydir\my.xml"

[xml]$xmlDoc = New-Object system.Xml.XmlDocument
$xmlDoc.Load($FilePath)

 

or even simpler:

 

[xml]$xmldoc = Get-Content -Path C:\mydir\my.xml

 

Now you have an XML object with data contents with you. Do whatever you want to with it.

 

Examples? If you have WFA 3.0 you can look at WfaConfig.psm1 located at WFA\PoSH\Modules\WFAWrapper. 

 

 

sinhaa

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Sudeep
2,690 Views

thanks for the Reply sinhaa

 

ll definitely try it out n get back if i have any problems.

 

 

Public