Hi,
Here is the script:
#
param (
[Parameter(Mandatory=$true)][string]$InFolderPath,
[Parameter(Mandatory=$true)][string]$XMLFilePath
)
$InFolderPath = $InFolderPath + "\*"
#Array of [login to view URL]
$RollBackFiles = Get-ChildItem -Path $InFolderPath -Include "*[login to view URL]" |%{ $[login to view URL] -replace "_rollback", ""}
#Array of base .bp
$BPFiles = Get-ChildItem -Path $InFolderPath -Include "*.bp" -Exclude "*[login to view URL]" |%{ $[login to view URL]}
#Create XML Doc
[xml]$XMLDoc = New-Object [login to view URL]
#Add Declaration to the XML Doc
$Declaration = $[login to view URL]("1.0","UTF-8",$null)
$[login to view URL]($Declaration) |Out-Null
#Add Root Node to the XML Doc (UnpairedFileList)
$UnpairedListRoot = $[login to view URL]("element","UnpairedFileList",$null)
#Add File and Name nodes foreach unpaired base file
foreach ($file in $BPFiles | where {$_ -notin $RollBackFiles}) {
#Create File node
$FileNode = $[login to view URL]("element","File",$null)
#Create Name element and set its value to the file
$NameNode = $[login to view URL]("Name")
$[login to view URL] = $file +".bp"
#Add Name as child to the File
$[login to view URL]($NameNode) | Out-Null
#Add File as child to the Root
$[login to view URL]($FileNode) | Out-Null
}
#Add Root to the XML Document
$[login to view URL]($UnpairedListRoot) | Out-Null
#Save
$[login to view URL]($XMLFilePath)
#to call it: [login to view URL] -noexit -file "C:\[login to view URL]" "C:\Inputs" "C:\[login to view URL]"
Hope it helps
Regards
Marcin