Switch Expand-Archive to 7zip on Windows image generation (#861)

* switch expand-archive to 7zip on windows
This commit is contained in:
Dibir Magomedsaygitov
2020-05-13 08:02:08 +03:00
committed by GitHub
parent ffa2110464
commit 3e9c8e5afc
10 changed files with 37 additions and 17 deletions

View File

@@ -386,3 +386,22 @@ function Test-IsWin16
{
(Get-WinVersion) -match "2016"
}
function Extract-7Zip {
param
(
[Parameter(Mandatory=$true)]
[string]$Path,
[Parameter(Mandatory=$true)]
[string]$DestinationPath
)
Write-Host "Expand archive '$PATH' to '$DestinationPath' directory"
7z.exe x "$Path" -o"$DestinationPath" -y | Out-Null
if ($LASTEXITCODE -ne 0)
{
Write-Host "There is an error during expanding '$Path' to '$DestinationPath' directory"
exit 1
}
}