Jump to content
Ketarin forum

How to export all applications to separate XML per Application


Etz
 Share

Recommended Posts

  • 1 year later...

The PowerShell script I use to split an applications-export XML file into individual XML files:

$inFile = $args[0]
$directory = Split-Path -Parent $MyInvocation.MyCommand.Path
$ketarinExport = [xml](Get-Content $inFile)
foreach ($job in $ketarinExport.Jobs.ApplicationJob)
{
    [xml]$xmlDoc = New-Object system.Xml.XmlDocument
    $xmlDoc.LoadXml("<?xml version=`"1.0`" encoding=`"utf-8`"?><Jobs/>")
    $xmlNode = $xmlDoc.ImportNode($job, $true)
    $null = $xmlDoc.LastChild.AppendChild($xmlNode)

    $outFile = Join-Path $directory ($job.Name + ".xml")
    $xmlDoc.Save($outFile)
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.