-
Notifications
You must be signed in to change notification settings - Fork 2
/
RedumpToDirectory.ps1
38 lines (29 loc) · 1.11 KB
/
RedumpToDirectory.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms")|Out-Null
$DeleteSource = "a"
$Yes = @("Yes", "YES", "yes", "Y", "y")
$No = @("No", "NO", "no", "N", "n")
while(-not($Yes.contains($DeleteSource) -or $No.contains($DeleteSource))) {
$DeleteSource = Read-Host -Prompt "Delete Source? [Y]es or [N]o"
}
$GetSource = New-Object System.Windows.Forms.FolderBrowserDialog
$GetSource.Description = "Select Redump Source Directory"
$GetSource.rootfolder = "MyComputer"
if($GetSource.ShowDialog() -eq "OK"){
$SourceDir = $GetSource.SelectedPath
}
$GetDest = New-Object System.Windows.Forms.FolderBrowserDialog
$GetDest.Description = "Select Game Directories Destination"
$GetDest.rootfolder = "MyComputer"
if($GetDest.ShowDialog() -eq "OK"){
$DestDir = $GetDest.SelectedPath
}
$Games = Get-ChildItem -Path $SourceDir -Filter *.iso
foreach($Game in $Games) {
echo("Extracting $Game...")
$GameName = $Game.BaseName
./extract-xiso.exe -q -d $DestDir\$GameName $SourceDir\$Game
#Delete source
if($Yes.contains($DeleteSource)) {
Remove-Item $SourceDir\$Game
}
}