Skip to content

fix: wmic removal #1721 - #1722

Merged
wenyt (wenytang-ms) merged 4 commits into
microsoft:mainfrom
ago1024:main
Oct 30, 2026
Merged

wenyt (wenytang-ms) merged 4 commits into
microsoft:mainfrom
ago1024:main

Conversation

@ago1024

Copy link
Copy Markdown
Contributor

The PR replaces the call to wmic.exe with a call to powershell Get-CimInstance Win32_process.

The output of the script is similar to the old wmic output. CreationDate was omited because it's not used anywhere and the old parsing logic to parse the date does not work with the input from the script.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@ago1024

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Comment thread src/processTree.ts Outdated
Comment thread src/processTree.ts Outdated
@wenytang-ms

Copy link
Copy Markdown
Contributor

Alexander Gottwald (@ago1024) Thanks for submitting the PR! I left two inline suggestions for the PowerShell invocation and output encoding. Please take a look when you have a chance.

@wenytang-ms
wenyt (wenytang-ms) requested a balanced review from Copilot October 30, 2026 01:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the switch from WMIC to PowerShell-based Windows process discovery.

No open issues 🎉

What changed in this PR

Replaces Windows process discovery through wmic.exe with PowerShell’s Get-CimInstance Win32_Process, preserving the process information used by the debugger.

Changes:

  • Removes the unused creation-date field from Windows process parsing.
  • Handles UTF-8 output, restricted PowerShell language modes, and process records split across output chunks.
  • Adds tests for PowerShell invocation, Unicode handling, encoding restrictions, and failure reporting.
File Description
test/​processTree.test.ts Adds mocked discovery tests and Windows-only PowerShell script tests.
src/​processTree.ts Switches to PowerShell, enforces UTF-8 output, and corrects chunked-line parsing.

Review effort: Balanced

@wenytang-ms wenyt (wenytang-ms) changed the title wmic removal #1721 fix: wmic removal #1721 Oct 30, 2026
@wenytang-ms
wenyt (wenytang-ms) merged commit a114556 into microsoft:main Oct 30, 2026
4 checks passed
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.

4 participants