Active IQ Unified Manager Discussions

Can WFA parse xml data ???

Sudeep
3,372 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
3,365 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
3,366 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
3,346 Views

thanks for the Reply sinhaa

 

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

 

 

Public