microsoft/microsoft-ui-xaml/test-on-vm

Claude Code and agent skill by microsoft/microsoft-ui-xaml

Trust tier 4
  • vendor
Source check pending

Checking that the SKILL.md file is still in the repository.

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.

Install

npx vskill@latest install microsoft/microsoft-ui-xaml/test-on-vm

SKILL.md

The same SKILL.md was published earlier as microsoft/microsoft-ui-xaml/test-on-vm.

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:

powershell
.\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:

powershell
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

powershell
# 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:

powershell
$vmName = "<vm>"
$credentialKey = $vmName -replace '[^a-zA-Z0-9]', '_'
$cred = Import-Clixml "~\.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
}

Always access ".winui-test\" via "~\.winui-test", without changing the "~\" to some other form.

For a quick local analysis:

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

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 1 Oct 2026.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
8,484
Repository forks
950
7-day trend score
45

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill CERTIFIED badge
[![vskill CERTIFIED](https://verified-skill.com/api/v1/skills/microsoft/microsoft-ui-xaml/test-on-vm/badge)](https://verified-skill.com/skills/microsoft/microsoft-ui-xaml/test-on-vm)

Something wrong with this skill or its page? Tell us.