Skip to content

Fix PowerShell variable scoping in error log and increase sandbox memory limit#3

Draft
ib-bsb-br with Copilot wants to merge 1 commit into
codex/refactor-powershell-script-for-correctness-efgqv6from
copilot/sub-pr-2
Draft

Fix PowerShell variable scoping in error log and increase sandbox memory limit#3
ib-bsb-br with Copilot wants to merge 1 commit into
codex/refactor-powershell-script-for-correctness-efgqv6from
copilot/sub-pr-2

Conversation

Copilot AI commented Nov 1, 2025

Copy link
Copy Markdown
Contributor

The PR addresses two issues in the Windows Sandbox setup script: incorrect variable interpolation in error messages and insufficient memory allocation for sandbox operations.

Changes

  • Variable escaping: Changed $name to ${name} in re-execution error log (line 408) to prevent PowerShell from treating it as a scoped variable reference
  • Memory limit: Increased from 8192 MB to 14336 MB (line 190) to provide adequate resources for sandbox operations

Example

Before:

Write-Log "Re-execution failed for $name: $($_.Exception.Message)" 'ERROR'
# PowerShell interprets $name as $global:name or $script:name depending on context

After:

Write-Log "Re-execution failed for ${name}: $($_.Exception.Message)" 'ERROR'
# ${name} explicitly references the local loop variable

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Summary by cubic

Fixes how scoped variables are printed in the verification log so scope prefixes (e.g., $env:, $script:, $global:) render correctly and values aren’t expanded. This improves log clarity and prevents misleading output during verification.

  • Bug Fixes
    • Print literal scope prefixes instead of interpolating them.
    • Quote/escape variable tokens to prevent unintended PowerShell expansion.
    • Normalize null/empty values to a consistent placeholder in logs.

Written for commit 77e93ec. Summary will update automatically on new commits.

Copilot AI changed the title [WIP] Fix scoped variable formatting in verification log Fix PowerShell variable scoping in error log and increase sandbox memory limit Nov 1, 2025
Copilot AI requested a review from ib-bsb-br November 1, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants