• Blitz Shadow Player
  • Caius
  • redboot
  • Rules
  • Chain of Command
  • Members
  • Supported Ladders & Games
  • Downloads


Simple art updater script
12-31-2019, 01:48 PM, (This post was last modified: 12-31-2019, 01:55 PM by blond_knight.)
#3
RE: Simple art updater script
Here's a small variation. Ive moved all my Panzer Campaign games into a single folder in my games directory.  Now I can reset or update all of them at once.

Code:
#Source Panzer campaigns game main folder
$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'
$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
}
}
}
Quote this message in a reply


Messages In This Thread
Simple art updater script - by blond_knight - 12-30-2019, 08:37 AM
RE: Simple art updater script - by blond_knight - 12-30-2019, 08:50 AM
RE: Simple art updater script - by blond_knight - 12-31-2019, 01:48 PM
RE: Simple art updater script - by blond_knight - 01-30-2020, 07:21 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)