fix failing extracting directory to file
This commit is contained in:
parent
065cffb2a7
commit
7ecd8e8fba
1 changed files with 4 additions and 2 deletions
|
@ -209,10 +209,12 @@ function Extract-And-Override-Zip([string]$ZipPath, [string]$OutPath) {
|
|||
foreach ($entry in $Zip.Entries) {
|
||||
$DestinationPath = Get-Absolute-Path $(Join-Path -Path $OutPath -ChildPath $entry.FullName)
|
||||
$DestinationDir = Split-Path -Parent $DestinationPath
|
||||
if (-not $DestinationPath.EndsWith("\")) {
|
||||
New-Item -ItemType Directory -Force -Path $DestinationDir | Out-Null
|
||||
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($entry, $DestinationPath, $true)
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
if ($Zip -ne $null) {
|
||||
$Zip.Dispose()
|
||||
|
|
Loading…
Reference in a new issue