fix: PowerShell fallback when wmic is unavailable on Windows (0.6.1)#32
Merged
Conversation
b54ed8d to
0f9f83b
Compare
8eb1680 to
46b15a6
Compare
Old Node (4-14) no longer installs on current runners (no arm64 builds on macOS), so test the supported 18-current range instead. Pin the lint job to Node 14 where the legacy xo still runs.
46b15a6 to
8f48da7
Compare
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.
wmic was removed from Windows 11 24H2 and Windows Server 2025, so pidtree throws
spawn wmic ENOENTon those machines (#18, #20, #26, #31).On Windows it now tries wmic first and falls back to PowerShell (
Get-CimInstance Win32_Process) when wmic isn't found, so there's no slowdown where wmic still exists. The command is passed via-EncodedCommandto avoid arg-quoting issues, and$ProgressPreferenceis silenced so PowerShell's progress output isn't mistaken for an error on stderr.Kept as a non-breaking 0.6.1: still CJS, zero deps, same API. The ESM / Node 18 / toolchain refresh is a separate follow-up.
Added unit tests for the parser and the fallback. CI is also updated in a second commit: the old Node matrix (4–14) no longer installs on current runners, so it now tests 18–current. The Windows job runs on Server 2025, which has no wmic, so its integration suite exercises the fallback directly. The lint job is pinned to Node 14, where the legacy xo still runs (the toolchain update will fix that properly).
Supersedes #30, which took the same PowerShell route.