fix Expand-Archive
This commit is contained in:
@@ -655,6 +655,7 @@ Function Expand-Archive {
|
|||||||
If ( [System.IO.Path]::GetExtension($Path) -ne ".zip" ) { Write-Output "The path specified is not a zip file: ""${Path}""" ; Exit }
|
If ( [System.IO.Path]::GetExtension($Path) -ne ".zip" ) { Write-Output "The path specified is not a zip file: ""${Path}""" ; Exit }
|
||||||
If ( [string]::IsNullOrEmpty($DestinationPath) ) { $DestinationPath = Split-Path -Parent $Path }
|
If ( [string]::IsNullOrEmpty($DestinationPath) ) { $DestinationPath = Split-Path -Parent $Path }
|
||||||
Try {
|
Try {
|
||||||
|
Add-Type -Assembly "System.IO.Compression"
|
||||||
Add-Type -Assembly "System.IO.Compression.FileSystem"
|
Add-Type -Assembly "System.IO.Compression.FileSystem"
|
||||||
Write-Output "Extracting ""${Path}"" to ""${DestinationPath}"""
|
Write-Output "Extracting ""${Path}"" to ""${DestinationPath}"""
|
||||||
[System.IO.Compression.ZipArchive]$SourceArchive = [System.IO.Compression.ZipFile]::Open($Path, [System.IO.Compression.ZipArchiveMode]::Read)
|
[System.IO.Compression.ZipArchive]$SourceArchive = [System.IO.Compression.ZipFile]::Open($Path, [System.IO.Compression.ZipArchiveMode]::Read)
|
||||||
|
|||||||
Reference in New Issue
Block a user