All the folders in screenshot are created by copying and renaming one Template folder. Now all sub-folders contains one xml file, need to update the path in these xml's with the path of Crystal Reports and DocMan folder, which exist in all these folders.
[xml]$XmlDocument = Get-Content -Path d:\Site\"$($name)\$($name)
.xml"
$XmlDocument.breakfast_men
u.food.Doc
Man = 'd:\Site\'
$XmlDocument.breakfast_men
u.food.Cry
stalreport
s = 'd:\Site\'
$XmlDocument.Save("D:\Site
\"$($name)
\$($name).
xml")
The above script is not giving the desired result.
My earlier script for copying and renaming:
$source = 'd:\Site\Template'
$target = 'd:\Site\'
$xmlPath = 'D:\Tenant.xml'
$xml = [xml](Get-Content -Path $xmlPath)
$envCode = $xml.SelectSingleNode('Ten
ants/ENVco
de').Inner
Text.Trim(
)
$xml.SelectNodes('Tenants/
Schools/Sc
hool') | ForEach-Object {
$name = "$($envCode)-$($_.InnerTex
t.Trim())"
$destination = Join-Path -Path $target -ChildPath $name
Copy-Item -Path $source -Destination $destination -Recurse -Force -Verbose
Get-ChildItem -Path $destination -Filter default.xml -Recurse | Rename-Item -NewName "$($name).xml"
}
Screenshot.png