Skip to content

Commit 10f3326

Browse files
authored
Add files via upload
1 parent 8db5ae4 commit 10f3326

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Scripts/Others/Extract-Files.ps1

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Add-Type -AssemblyName "System.Windows.Forms"
2+
3+
function Show-OpenFileDialog {
4+
$dialog = New-Object System.Windows.Forms.OpenFileDialog
5+
$dialog.Filter = "ZIP Archive (*.zip)|*.zip"
6+
$dialog.Title = "Select ZIP File"
7+
if ($dialog.ShowDialog() -eq "OK") {
8+
return $dialog.FileName
9+
}
10+
return $null
11+
}
12+
13+
function Show-FolderBrowserDialog {
14+
$dialog = New-Object System.Windows.Forms.FolderBrowserDialog
15+
$dialog.Description = "Select Destination Folder"
16+
if ($dialog.ShowDialog() -eq "OK") {
17+
return $dialog.SelectedPath
18+
}
19+
return $null
20+
}
21+
22+
$zipFile = Show-OpenFileDialog
23+
if (-not $zipFile) {
24+
Write-Host "No ZIP file selected. The script will be canceled."
25+
exit
26+
}
27+
28+
$destinationFolder = Show-FolderBrowserDialog
29+
if (-not $destinationFolder) {
30+
Write-Host "No destination folder selected. The script will be canceled."
31+
exit
32+
}
33+
34+
Expand-Archive -Path $zipFile -DestinationPath $destinationFolder

0 commit comments

Comments
 (0)