<?xml version="1.0" encoding="UTF-8"?>
<abc>
<myTask id="MyBatchExport" name="MyBatchExport" scriptFormat="javascript">
<task><![CDATA[var requestItemsParm= execution.getVariable("requestItems");
var requestItemsParm= JSON.parse(requestItemsParm);
var batchExport = {};]]></task>
</myTask>
<myTask id="MyBatchImport" name="MyBatchImport" scriptFormat="javascript">
<task><![CDATA[var requestItemsParm= execution.getVariable("requestItems");
var requestItemsParm= JSON.parse(requestItemsParm);
var batchImport = {};]]></task>
</myTask>
</abc>
Based on the Mytask tag id value, have to replace the task data with other string content using powershell
$xmldata = [xml](Get-Content test1.xml);
$StrContent = "my own content to replace in between CDATA"
$taskdata= $xmldata.abc.myTask.task
with above assignment, i can get all task data as array. But i want to task tag value if id is equal to "MyBatchImport" or "MyBatchExport" or some "xyz"
Can someone help me here