Skip to content

Commit 3639d8e

Browse files
author
devizer
committed
Update 7z
1 parent a6abc16 commit 3639d8e

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

Install-SqlServer-Version-Management.ps1

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Param(
44
)
55

66
$ModuleName = 'SqlServer-Version-Management';
7-
$ModuleVersion = '2.1.186';
7+
$ModuleVersion = '2.1.187';
88
$ModuleFiles = @(
99
@{
1010
FileName = 'SqlServer-Version-Management\SqlServer-Version-Management.psd1';
@@ -15,7 +15,7 @@ $ModuleFiles = @(
1515
" ModuleToProcess = @('SqlServer-Version-Management.psm1')",
1616
"",
1717
" # Version below is automatically incremented on build",
18-
" ModuleVersion = `"2.1.186`"",
18+
" ModuleVersion = `"2.1.187`"",
1919
"",
2020
" GUID = 'dd03b53d-575a-4056-ae08-e6dfea3384ea'",
2121
"",
@@ -945,19 +945,18 @@ $ModuleFiles = @(
945945
"",
946946
"function ExtractArchiveBy7zMini([string] `$fromArchive, [string] `$toDirectory) {",
947947
" New-Item -Path `"`$(`$toDirectory)`" -ItemType Directory -Force -EA SilentlyContinue | Out-Null",
948-
" pushd `"`$(`$toDirectory)`"",
949948
" `$mini7z = `"`$(Get-Mini7z-Exe-FullPath-for-Windows)`"",
950-
" # `"-o```"`$plainFolder```"`"",
951-
" `$commandLine=@(`"x`", `"-y`", `"```"`$fromArchive```"`")",
949+
" `$commandLine=@(`"x`", `"-y`", `"-o```"`$(`$toDirectory)```"`", `"```"`$fromArchive```"`")",
952950
" `$singleCore7z=@(); `$memInfo = Get-Memory-Info; `$procCount = ([Environment]::ProcessorCount); if (`$memInfo -and (`$memInfo.Free) -and (`$memInfo.Free -lt (640*`$procCount))) { `$singleCore7z=@(`"-mmt=1`") }",
953951
" `$commandLine += `$singleCore7z",
954-
" Troubleshoot-Info `"fromArchive: '`$fromArchive'; commandLine: '`$commandLine'`"",
952+
" Troubleshoot-Info `"7z-mini: '`$mini7z'; commandLine: '`$commandLine' ('`$fromArchive' ---> '`$toDirectory')`"",
955953
" # ok on pwsh and powersheel",
956-
" & `"`$mini7z`" @commandLine",
954+
" & `"`$mini7z`" @commandLine >`$null",
957955
" `$isExtractOk = `$?;",
958956
" return `$isExtractOk;",
959957
"}",
960958
"",
959+
"",
961960
"function ExtractArchiveByDefault7zFull([string] `$fromArchive, [string] `$toDirectory, `$extractCommand = `"x`") {",
962961
" New-Item -Path `"`$(`$toDirectory)`" -ItemType Directory -Force -EA SilentlyContinue | Out-Null",
963962
" # pushd `"`$(`$toDirectory)`"",

SqlServer-Version-Management.ps1

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -812,19 +812,18 @@ function Get-Full7z-Exe-FullPath-for-Windows([string] $arch, [string] $version =
812812

813813
function ExtractArchiveBy7zMini([string] $fromArchive, [string] $toDirectory) {
814814
New-Item -Path "$($toDirectory)" -ItemType Directory -Force -EA SilentlyContinue | Out-Null
815-
pushd "$($toDirectory)"
816815
$mini7z = "$(Get-Mini7z-Exe-FullPath-for-Windows)"
817-
# "-o`"$plainFolder`""
818-
$commandLine=@("x", "-y", "`"$fromArchive`"")
816+
$commandLine=@("x", "-y", "-o`"$($toDirectory)`"", "`"$fromArchive`"")
819817
$singleCore7z=@(); $memInfo = Get-Memory-Info; $procCount = ([Environment]::ProcessorCount); if ($memInfo -and ($memInfo.Free) -and ($memInfo.Free -lt (640*$procCount))) { $singleCore7z=@("-mmt=1") }
820818
$commandLine += $singleCore7z
821-
Troubleshoot-Info "fromArchive: '$fromArchive'; commandLine: '$commandLine'"
819+
Troubleshoot-Info "7z-mini: '$mini7z'; commandLine: '$commandLine' ('$fromArchive' ---> '$toDirectory')"
822820
# ok on pwsh and powersheel
823-
& "$mini7z" @commandLine
821+
& "$mini7z" @commandLine >$null
824822
$isExtractOk = $?;
825823
return $isExtractOk;
826824
}
827825

826+
828827
function ExtractArchiveByDefault7zFull([string] $fromArchive, [string] $toDirectory, $extractCommand = "x") {
829828
New-Item -Path "$($toDirectory)" -ItemType Directory -Force -EA SilentlyContinue | Out-Null
830829
# pushd "$($toDirectory)"

0 commit comments

Comments
 (0)