fix Expand-Archive

This commit is contained in:
2023-11-01 15:51:24 -04:00
parent 7a89f0b85e
commit 81bbde43ab
+1
View File
@@ -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 ( [string]::IsNullOrEmpty($DestinationPath) ) { $DestinationPath = Split-Path -Parent $Path }
Try {
Add-Type -Assembly "System.IO.Compression"
Add-Type -Assembly "System.IO.Compression.FileSystem"
Write-Output "Extracting ""${Path}"" to ""${DestinationPath}"""
[System.IO.Compression.ZipArchive]$SourceArchive = [System.IO.Compression.ZipFile]::Open($Path, [System.IO.Compression.ZipArchiveMode]::Read)