fix failing extracting directory to file

This commit is contained in:
Krzysztof Wicher 2016-03-14 12:23:27 -07:00
parent 065cffb2a7
commit 7ecd8e8fba

View file

@ -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()