Skip to content

Commit ac0f129

Browse files
author
devizer
committed
Update 7z
1 parent 0c8502b commit ac0f129

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

Install-SqlServer-Version-Management.ps1

Lines changed: 5 additions & 3 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.189';
7+
$ModuleVersion = '2.1.190';
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.189`"",
18+
" ModuleVersion = `"2.1.190`"",
1919
"",
2020
" GUID = 'dd03b53d-575a-4056-ae08-e6dfea3384ea'",
2121
"",
@@ -946,12 +946,14 @@ $ModuleFiles = @(
946946
"function ExtractArchiveBy7zMini([string] `$fromArchive, [string] `$toDirectory) {",
947947
" New-Item -Path `"`$(`$toDirectory)`" -ItemType Directory -Force -EA SilentlyContinue | Out-Null",
948948
" `$mini7z = `"`$(Get-Mini7z-Exe-FullPath-for-Windows)`"",
949-
" `$commandLine=@(`"x`", `"-y`", `"-o```"`$(`$toDirectory)```"`", `"`$fromArchive`")",
949+
" `$commandLine=@(`"x`", `"-y`", `"-o```"`$(`$toDirectory)```"`", `"```"`$fromArchive```"`")",
950950
" `$singleCore7z=@(); `$memInfo = Get-Memory-Info; `$procCount = ([Environment]::ProcessorCount); if (`$memInfo -and (`$memInfo.Free) -and (`$memInfo.Free -lt (640*`$procCount))) { `$singleCore7z=@(`"-mmt=1`") }",
951951
" `$commandLine += `$singleCore7z",
952952
" Troubleshoot-Info `"7z-mini: '`$mini7z'; commandLine: '`$commandLine' ('`$fromArchive' ---> '`$toDirectory')`"",
953953
" # ok on pwsh and powersheel",
954+
" `$prevPass = `$PSNativeCommandArgumentPassing; `$PSNativeCommandArgumentPassing = `"Legacy`"",
954955
" & `"`$mini7z`" @commandLine >`$null",
956+
" `$PSNativeCommandArgumentPassing = `$prevPass",
955957
" `$isExtractOk = `$?;",
956958
" return `$isExtractOk;",
957959
"}",

SqlServer-Version-Management.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,12 +813,14 @@ function Get-Full7z-Exe-FullPath-for-Windows([string] $arch, [string] $version =
813813
function ExtractArchiveBy7zMini([string] $fromArchive, [string] $toDirectory) {
814814
New-Item -Path "$($toDirectory)" -ItemType Directory -Force -EA SilentlyContinue | Out-Null
815815
$mini7z = "$(Get-Mini7z-Exe-FullPath-for-Windows)"
816-
$commandLine=@("x", "-y", "-o`"$($toDirectory)`"", "$fromArchive")
816+
$commandLine=@("x", "-y", "-o`"$($toDirectory)`"", "`"$fromArchive`"")
817817
$singleCore7z=@(); $memInfo = Get-Memory-Info; $procCount = ([Environment]::ProcessorCount); if ($memInfo -and ($memInfo.Free) -and ($memInfo.Free -lt (640*$procCount))) { $singleCore7z=@("-mmt=1") }
818818
$commandLine += $singleCore7z
819819
Troubleshoot-Info "7z-mini: '$mini7z'; commandLine: '$commandLine' ('$fromArchive' ---> '$toDirectory')"
820820
# ok on pwsh and powersheel
821+
$prevPass = $PSNativeCommandArgumentPassing; $PSNativeCommandArgumentPassing = "Legacy"
821822
& "$mini7z" @commandLine >$null
823+
$PSNativeCommandArgumentPassing = $prevPass
822824
$isExtractOk = $?;
823825
return $isExtractOk;
824826
}

0 commit comments

Comments
 (0)