Repository navigation
Add unattended mode to SandboxTest.ps1 - #441419
Open
Kaleb Luedtke (Trenly) wants to merge 3 commits into
Open
Kaleb Luedtke (Trenly) wants to merge 3 commits into
Kaleb Luedtke (Trenly) wants to merge 3 commits into
Conversation
* Add -Unattended <minutes> to wait for the sandbox run and surface its output on the host * Write a transcript, metadata.json and WinGet logs to a Results folder inside the sandbox * Document the new option, the results layout and exit code 5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Changes to one or more files in your PR require authorization to modify. This PR has been assigned to our on call staff to evaluate. Template: msftbot/requiresApproval/MSFT |
Contributor
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Kaleb Luedtke (Trenly)
marked this pull request as ready for review
September 26, 2026 03:28
Kaleb Luedtke (Trenly)
requested review from
a team and
Demitrius Nelon (denelon)
as code owners
September 26, 2026 03:28
Demitrius Nelon (denelon)
approved these changes
Sep 26, 2026
Collaborator
|
Kaleb Luedtke (@Trenly) it looks like the script analyzer failed |
Contributor
Author
It passed locally - thats not an error I've seen before. Will investigate |
Contributor
Author
|
Demitrius Nelon (@denelon) - I've merged the upstream to see if that resolves the issue. Here's the confirmation of the workflow passing on by branch from the original commit: https://github.com/Trenly/winget-pkgs/actions/runs/36213753043 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📖 Description
Adds an opt-in unattended mode to
Tools\SandboxTest.ps1so the output of the PowerShell session running inside Windows Sandbox can be read from the host. Today the script starts the Sandbox and returns immediately, which means scripted or automated manifest testing has no way to see whether the install succeeded.A new
-Unattended <minutes>parameter makes the script wait for the Sandbox session to finish and then write its output to the caller. The value is the timeout in minutes and is required, since PowerShell cannot make a parameter value optional. When the parameter is omitted the script behaves exactly as it does today.Inside the Sandbox
winget installoutput throughOut-Hostso Windows PowerShell 5.1 captures native command outputmetadata.json: WinGet version, OS build, manifest folder name, thewinget installexit code in decimal and hexadecimal, the-Scriptexit status, and start/end timestampsDiagOutputDirlogs outdonemarker from afinallyblock so it is always writtenOn the host
donemarker until the timeout, then writes the transcript, the result paths and the metadata to the output5on timeout, after writing whatever partial transcript existsResults are written to
%LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\SandboxTest\Resultsastranscript.log,metadata.json,WinGetLogs\anddone.Files changed
Tools/SandboxTest.ps1- the new parameter and the unattended code pathsdoc/tools/SandboxTest.md- the new option, an Unattended Mode section covering the results layout, and exit code 5.github/actions/spelling/expect.txt- addsbbweandwekyb, the tokens spell checking splits out of the WinGet package family nameMicrosoft.DesktopAppInstaller_8wekyb3d8bbweused in the new documentationTools/PRTest.ps1is unchanged.Validation
PSScriptAnalyzer, Pester Tests and Spell Checking pass on the fork. Verified with real Sandbox runs on Windows 11 26100:
-Unattended 15with a manifest and a-ScriptInstallExitCode0, script output captured, WinGet logs copiedInstallerSha256InstallExitCode-1978335215/0x8A150011captured in the metadata-Unattended 1against a script that sleeps past the timeout-UnattendedCopilot assisted with this change.
✅ Checklist
📦 Manifest Checklist
Not applicable; this PR does not modify any manifests.