The community is undergoing maintenance and is in Read-Only mode. Click to learn more.

Active IQ Unified Manager Discussions

Can WFA parse xml data ???

Sudeep

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

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

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

Sudeep

thanks for the Reply sinhaa

 

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

 

 

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public