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,8 +209,10 @@ 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
|
||||
New-Item -ItemType Directory -Force -Path $DestinationDir | Out-Null
|
||||
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($entry, $DestinationPath, $true)
|
||||
if (-not $DestinationPath.EndsWith("\")) {
|
||||
New-Item -ItemType Directory -Force -Path $DestinationDir | Out-Null
|
||||
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($entry, $DestinationPath, $true)
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
|
|
Loading…
Reference in a new issue