From c33a3c70b766128be837db1d6af29b10ebc60a2c Mon Sep 17 00:00:00 2001 From: ThioJoe <12518330+ThioJoe@users.noreply.github.com> Date: Sat, 15 Nov 2025 17:48:38 -0700 Subject: [PATCH 1/2] SandboxStartup.ps1 - Add line to enable clipboard history --- Startup Scripts/SandboxStartup.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Startup Scripts/SandboxStartup.ps1 b/Startup Scripts/SandboxStartup.ps1 index 89653f0..3e8da97 100644 --- a/Startup Scripts/SandboxStartup.ps1 +++ b/Startup Scripts/SandboxStartup.ps1 @@ -32,6 +32,9 @@ CiTool.exe --refresh --json | Out-Null # Refreshes policy. Use json output param # Change execution policy for powershell to allow running scripts. Normally it shows an error about a more specific policy (Process level Bypass policy), but it doesn't matter so we hide it via try/catch try { Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine -ErrorAction Stop | Out-Null } catch {} +# Enable Clipboard History +Set-ItemProperty -Path "HKCU:\Software\Microsoft\Clipboard" -Name "EnableClipboardHistory" -Value 1 -Type DWord -Force + # ----------------------------------------------------------------------------------------- # ---- Add 'Open PowerShell Here' and 'Open CMD Here' to context menu ------- From dce21532284e8cf7c5e1366882428d6e0df29669 Mon Sep 17 00:00:00 2001 From: Jean-Luc Tcharnetsky <88255067+Jean-LucTch@users.noreply.github.com> Date: Thu, 18 Dec 2025 16:15:56 +0100 Subject: [PATCH 2/2] Add .NET fallback on Expand-Archive fail The `Expand-Archive` cmdlet fails in localized Windows Sandbox environments (e.g., de-DE) because the `Microsoft.PowerShell.Archive` module cannot find its localization resources (`ArchiveResources.psd1`) in the minimal OS image. --- Installer Scripts/Install-Winget.ps1 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Installer Scripts/Install-Winget.ps1 b/Installer Scripts/Install-Winget.ps1 index 1bafd78..8124c02 100644 --- a/Installer Scripts/Install-Winget.ps1 +++ b/Installer Scripts/Install-Winget.ps1 @@ -22,7 +22,7 @@ function Get-LatestRelease { return $null } - if (-not $releases) { Write-Error "No releases found for $repoOwner/$repoName."; return $null; } + if (-not $releases) { Write-Error "No releases found for $repoOwner/$repoName."; return $null; } # Pick the top entry once sorted by published_at descending $latestRelease = $releases | Sort-Object -Property published_at -Descending | Select-Object -First 1 @@ -125,8 +125,17 @@ if ($depsZipUrl) { # Remove existing Dependencies folder and expand the zip if (Test-Path $topDepsFolder) { Remove-Item -Path $topDepsFolder -Recurse -Force } - - Expand-Archive -LiteralPath $depsZipPath -DestinationPath $topDepsFolder -Force + + # Use Expand-Archive cmdlet by default because it's safe for constrained language mode. Fall back to .NET assembly if it fails. + try { + Expand-Archive -LiteralPath $depsZipPath -DestinationPath $topDepsFolder -Force -ErrorAction Stop + } + catch { + Write-Warning "Standard extraction failed, attempting .NET fallback. The error was: $($_.Exception.Message)" + # Fallback using .NET System.IO.Compression (Fixes issues in non-EN Windows Sandbox) + Add-Type -AssemblyName System.IO.Compression.FileSystem + [System.IO.Compression.ZipFile]::ExtractToDirectory($depsZipPath, $topDepsFolder) + } } else { Write-Warning "No $depsZipName found in $latestTag, skipping dependency download."; } @@ -156,4 +165,3 @@ if ($removeMsStoreAsSource.IsPresent) { # Automatically accept source agreements to avoid prompts. Mostly applies to msstore. winget list --accept-source-agreements | Out-Null } -