Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 1556870

Browse files
committed
Need to create destination directory in order to extract
1 parent 9316372 commit 1556870

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/extract-zip.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
$cd = (split-path $MyInvocation.MyCommand.Path -parent)
22
$zipPath = $args[0]
33
$zipDest = $args[1]
4+
5+
if (!(Test-Path $zipDest))
6+
{
7+
Write-Host " * Creating $zipDest..." -foregroundcolor "green"
8+
New-Item $zipDest -type directory -force
9+
}
10+
411
Write-Host " * Extracting files into $zipDest..." -foregroundcolor "green"
512
$shell = New-Object -com Shell.Application
613
$zipFile = $shell.NameSpace($zipPath)
7-
foreach($item in $zipFile.items())
14+
foreach ($item in $zipFile.items())
815
{
916
$shell.Namespace($zipDest).copyhere($item)
1017
}

0 commit comments

Comments
 (0)