Skip to content

fix: PowerShell fallback when wmic is unavailable on Windows (0.6.1) #6

fix: PowerShell fallback when wmic is unavailable on Windows (0.6.1)

fix: PowerShell fallback when wmic is unavailable on Windows (0.6.1) #6

name: test-windows-2025
# Smoke test on Windows Server 2025, where the wmic utility has been removed.
# This exercises the PowerShell fallback end to end on a real wmic-less machine.
on:
push:
branches: '*'
pull_request:
branches: '*'
jobs:
smoke:
runs-on: windows-2025
name: PowerShell fallback (no wmic)
steps:
- name: Setup repo
uses: actions/checkout@v4
- name: Setup node 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Confirm wmic is not available
shell: pwsh
run: |
if (Get-Command wmic -ErrorAction SilentlyContinue) {
Write-Error 'wmic is present; the PowerShell fallback would not be exercised'
exit 1
}
Write-Host 'wmic is absent, as expected on Windows Server 2025'
- name: Smoke test the library
run: node -e "require('./')(-1, function (err, list) { if (err) { console.error(err); process.exit(1); } if (!Array.isArray(list) || list.length === 0) { console.error('expected a non empty list of pids'); process.exit(1); } console.log('ok:', list.length, 'pids'); })"