ibi icon

Robocopy/Sync Steam-Games to NAS

ibi | PRO | 02/02/22 10:19:52 AM UTC (Edited) | 0 ⭐ | 635 👁️ | Never ⏰ | []
PowerShell |

790 B

|

None

|

0 👍

/

0 👎

# iterate gamedirs and sync to share
$scrpt = ($MyInvocation.MyCommand.Name) -replace ".ps1",""
if ($env:computername -eq "fozzie") { $gdirs = gci c:\local\steam\steamapps\common,d:\local\steam\steamapps\common -directory }
else { $gdirs = compare (gci c:\local\steam\steamapps\common,d:\local\steam\SteamApps\common) (gc \\kermit\share\backup\steam\userdata\FOZZIE\installed_games.txt) -passthru | ? { $_.SideIndicator -eq '<='} }
$gdirs | % { robocopy $_.fullname \\piggy\data\gd\steam\$_ /mir /s /dst /fft /xj /xa:sh /r:2 /w:5 /copy:dt /np /tee /log:c:\temp\$scrpt-$_.log}
c:\apps\7z\7za.exe a c:\temp\$scrpt-$env:computername.zip c:\temp\$scrpt*.log
move -path c:\temp\$scrpt-*.zip -destination \\kermit\logs\ -force
ri c:\temp\$scrpt*.log
write "*** $($MyInvocation.MyCommand.Name) finished ***"
 

Comments