agentleFS
MicrosoftKnown publishermicrosoft/microsoft-ui-xaml/.github/skills/test-on-vm/SKILL.md

test-on-vm

Skill8.5k starsChanged 2 months agoMITView on GitHub

EXPERIMENTAL. Run locally built WinUI interaction tests on a Hyper-V VM through PowerShell Direct. Use when asked to run WinUI tests on a local VM.

Trending

Quiet since August.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 1 mentionJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 1 mentionSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/microsoft-ui-xaml repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about microsoft/microsoft-ui-xaml

The biggest 5 of 24 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 24

Talked about on GitHub, Hacker News and Bluesky (24 times).

On GitHub · 12

7 more on GitHub

On Hacker News · 11

6 more on Hacker News

On Bluesky · 1

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run tools\run-tests-on-vm.ps1 through initrun.ps1.

    line 8
  2. Very specific:

    If Hyper-V permissions are missing, stop and ask the user to make the change themselves.

    line 28

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Run WinUI Tests on a Hyper-V VM

Run tools\run-tests-on-vm.ps1 through initrun.ps1. It refreshes the local test payload, deploys it to the VM, performs required machine setup, and runs tests on the VM's interactive desktop.

This skill and script are experimental and may not be stable.

Before You Run

Build the repository first. Follow the build skill:

.\initrun.ps1 .\build.cmd /q

Also verify:

  • The VM is running with an unlocked desktop and a logged-in user.
  • The caller is a local admin or a member of Hyper-V Administrators.
  • The command uses initial_wait of at least 180 seconds.

If Hyper-V permissions are missing, stop and ask the user to make the change themselves. Never run Add-LocalGroupMember or open an elevated shell on their behalf, even with their approval.

Tell the user to run whoami in their original, non-elevated PowerShell window and copy the account name. Then have them open a separate PowerShell (pwsh) window using Run as administrator and run this command, replacing <account-from-whoami> with the copied name:

Add-LocalGroupMember -Group 'Hyper-V Administrators' -Member '<account-from-whoami>'

Tell the user to sign out and back in afterward. Wait for them to confirm they have completed these steps before retrying the test.

The first run prompts for VM credentials in a separate window and caches them encrypted under ~\.winui-test. Use -ResetCredential to replace them.

Run Tests

# Run a specific test
.\initrun.ps1 .\tools\run-tests-on-vm.ps1 -VMName <vm> <testname>

# Wildcard match
.\initrun.ps1 .\tools\run-tests-on-vm.ps1 -VMName <vm> *CommandBar*

# Force full copy instead of incremental
.\initrun.ps1 .\tools\run-tests-on-vm.ps1 -VMName <vm> -FullCopy <testname>

# Stop a stuck test run
.\initrun.ps1 .\tools\run-tests-on-vm.ps1 -VMName <vm> -Stop

Payload Rules

By default, the script runs test\CreateTestPayload.ps1 to refresh TestPayload\<flavor> from the current build outputs, then deploys changed files incrementally.

  • -FullCopy still refreshes the local payload, then copies all of it to the VM.
  • Use -SkipPayload rarely. It deploys the existing local payload without refreshing it. Use it only when that payload is known to be current or when intentionally testing stale binaries. Never use it merely to save time.

Useful Options

OptionPurpose
-Platformx86, x64, or arm64; uses $env:BUILDPLATFORM, then defaults to x64
-Configurationchk or fre; uses $env:_BuildType, then defaults to chk
-FullCopyCopy the full refreshed payload instead of only changes
-SkipPayloadRare: deploy the existing payload without refreshing it
-SkipPrerunSkip testmachine-prerun.cmd
-ForcePrerunRun testmachine-prerun.cmd again
-CredentialSupply a PSCredential instead of using the prompt/cache
-ResetCredentialClear the cached credential for this VM
-StopStop the active test and clean up

Troubleshooting

SymptomCauseFix
Could not launch app, foreground-window errors, or an empty UIA treeVM desktop is locked or not visibleKeep the VM desktop unlocked and active
Failed to connect to VMVM not running or wrong credentialsStart the VM; use -ResetCredential to re-enter credentials
Permission errorNeed Hyper-V Administrators membershipStop and have the user follow the permission steps above
Incomplete payload or prerun failureStale payload or partial deploymentOmit -SkipPayload; retry with -FullCopy if needed

Crash Dumps

The first prerun configures full crash dumps under C:\dumps on the VM, with up to three dumps per process. Pull one back through PowerShell Direct:

$vmName = "<vm>"
$credentialKey = $vmName -replace '[^a-zA-Z0-9]', '_'
$cred = Import-Clixml (Join-Path $env:USERPROFILE ".winui-test\vmcred-$credentialKey.xml")
$destination = Join-Path $env:TEMP "WinUIDumps"
New-Item -ItemType Directory -Path $destination -Force | Out-Null

$session = New-PSSession -VMName $vmName -Credential $cred
try {
    Invoke-Command -Session $session { Get-ChildItem C:\dumps\*.dmp }
    Copy-Item -FromSession $session -Path "C:\dumps\<dump>.dmp" -Destination $destination
}
finally {
    Remove-PSSession $session
}

For a quick local analysis:

cdb -z "$env:TEMP\WinUIDumps\<dump>.dmp" -c "!analyze -v; ~*k; q"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.