After reading Lowlanders post about making a terrain info box mod I decided to update my script to also support copy files from the master info folder.
Code:
#Source Panzer campaigns game main folder v1.3
$source = 'C:\games\master'
#Destination Panzer campaigns game main folder
$destinationgame = "C:\games\Panzer Campaigns\"
#Army list. Feel free to add any Ive missed in the same format.
$armies = 'American','American-AB','British','British-AB','Canadian','French','German','German-SS','Luftwaffe','italian',`
'Russian','Russian-Guards','Hungarian','nkvd','Belgian','Rumanian-allied','Netherland','Polish','Commonwealth'
$all = Get-ChildItem $destinationgame -Directory|select -ExpandProperty name
#Loops for each game
foreach ($game in $all)
{
$destination = $destinationgame+$game
$destination
#Loops for each army
foreach ($army in $armies)
{
#Check to see if destination army exists
$check = Test-Path $destination\$army
if ($check -eq 'True')
{
Write-Output "Populating $army"
Copy-Item $source\$army\2DSymbolsLg.bmp $destination\$army -Force
Copy-Item $source\$army\2DSymbolssm.bmp $destination\$army -Force
Copy-Item $source\$army\Unitbox.bmp $destination\$army -Force
Copy-Item $source\$army\Flag.bmp $destination\$army -Force
}
}
#Clean up of old Help files
Get-ChildItem $destination -file| Remove-Item -Include *.hlp, *.cnt
#Copy info folder files
Copy-Item $source\info\* $destination\info -Force -Recurse
}