-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(wmic): add gwmi command to be compatible with deleted wmic #143
base: main
Are you sure you want to change the base?
Conversation
aliuq
commented
Feb 22, 2022
Q | A |
---|---|
Branch? | main |
Bug fix? | yes |
New feature? | no |
Deprecations? | no |
Tickets | Fix #124 |
License | MIT |
Doc PR | no |
Hi @aliuq, thanks for the PR and sorry for the late reply On a side note, |
try { | ||
spawn('wmic', function (err) { | ||
if (err) throw new Error(err) | ||
}) | ||
} catch (err) { | ||
fn = gwmi | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this, isn't there another way to try and see if wmic is installed? I'd even say that we should check if gwmi
exists and use it if possible (wmic is old).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this PR still wants to be pursued, but leaving a comment in any case:
On Windows there's the where
1 command (~ equivalent to UNIX which
). This could be used to check whether gwmi
/ wmic
is available.
Though, this still requires a spawn
call.
Footnotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to be able to continue, but I haven't been following this for a long time and have been a little busy lately with my new job, so I may tackle this again in the next two weeks!
### 3.0.1 | ||
|
||
- fix wmic removed on Windows 11 and add gwmi support | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome, I'll suggest however to target a 4.x as its a new feature and we follow semver. I'll merge some pending patches but I'd love to see this being added, many thanks for the work!
P.S.: I had a windows environment at the time of coding the first version but now I don't anymore so its hard for me to test this.
is there any update on when this will be implemented, as i would like to use this in windows 11 which doesn't support wmic any more |
freel free to take it over I think that this is a good base but it needs more testing and some code review, you can open a new pr if needed. |