Hier das Skript dazu. WinRar muss installiert sein. Besonders die Nutzung von Winrar zur Archivierung mit Powershell dürfte auch für viele andere Zwecke Interessant sein.
Ich plane dafür ein Tool zu Bauen. Also ein Backup und Recovery Tool für Origin, UPlay und Steam. Hätte daran jemand interesse?
$UPlayStorage = "C:\Program Files (x86)\Spiele" $OriginStorage = "C:\Program Files (x86)\Origin Games" $Winrar = "c:\Program Files\WinRAR\rar.exe" $DestinationBase= "\\192.168.10.153\d$\Backup" function RarJob { param ( [String] $sourceFolder, [String] $dest ) Write-Host "WinRar ""$sourceFolder"" ""$dest""" [Array]$arguments = @("a", "-ac", "-m4", "-y", "-r", "-ac", "-ai", """$dest""", """$sourceFolder""") $process = Start-Process -FilePath "$Winrar" -ArgumentList $arguments -Wait -PassThru if ($process.ExitCode -eq 0) { Write-Verbose "$successful" } Write-Host $process.ExitCode } #Uplay function Backup-Uplay { if (-not (Test-path "$DestinationBase\UPlay")) { new-item "$DestinationBase\UPlay" -Type directory } foreach ($game in Get-ChildItem $UPlayStorage) { RarJob -sourceFolder $game.FullName -dest $("$DestinationBase\UPlay\" + $($game.Name -replace " ", "_") + ".rar") } } #Origin function Backup-Origin { if (-not (Test-path "$DestinationBase\Origin")) { new-item "$DestinationBase\Origin" -Type directory } foreach ($game in Get-ChildItem $OriginStorage) { RarJob -sourceFolder $game.FullName -dest $("$DestinationBase\Origin\" + $($game.Name -replace " ", "_") + ".rar") } } Backup-Origin