Hi,
i’m trying to create a node and append it to the existing xml file using below powershell code.
[xml]$temp = Get-Content C:\temp\test.xml
$device = $temp.CreateElement(“deviceâ€)
$device.InnerXml = “$dev”
$temp.TMMsg_CreateTaskReq.taskinfo.subTasks.options.restoreOptions.sqlServerRstOption.Appendchild($device)
$temp.Save(“C:\temp\test.xml”)
Here “$dev†has all the values to append in to xml file
part of xml file…where i would like to append the node…
<sqlServerRstOption>
<dbOnly>false</dbOnly>
<overWrite>true</overWrite>
<pointOfTimeRst>false</pointOfTimeRst>
<sqlRestoreType>DATABASE_RESTORE</sqlRestoreType>
<sqlRecoverType>STATE_RECOVER</sqlRecoverType>
<stopStartSSA>false</stopStartSSA>
<preserveReplicationSettings>false</preserveReplicationSettings>
<stopMarkRestore>false</stopMarkRestore>
<stopBeforeMarkRestore>false</stopBeforeMarkRestore>
<partialRestore>false</partialRestore>
<logShippingOnly>false</logShippingOnly>
<ffgRestore>false</ffgRestore>
<ignoreFullBackup>false</ignoreFullBackup>
<vSSBackup>false</vSSBackup>
<restoreSource>Informatica_Test11</restoreSource>
<database>Informatica_Test11</database>
<timeZone>
<TimeZoneName>(GMT-05:00) Eastern Time (US & Canada)</TimeZoneName>
</timeZone>
<keepDataCapture>false</keepDataCapture>
</sqlServerRstOption>
In the above xml code, new node “Device†is saving above sqlServerRstOption, but it should be between vSSBackup and restoreSource nodes.
Is there any way we could do that ?
Please let me know your suggestions…
Thanks in advance