-
Notifications
You must be signed in to change notification settings - Fork 23
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
Replace depricated WMIC with Get-CimInstance #54
Conversation
Have you tested this locally yourself? I pulled it down myself, and none of the tests are passing out of the box on my machine. E: My system complains that |
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.
Thank you so much for the patch (and the heads up about WMIC)! It's greatly appreciated.
I've tested it locally, and I'll be happy to accept the patch with the following changes:
diff --git src/authentication.ts src/authentication.ts
index 72d83d2..99ef778 100644
--- src/authentication.ts
+++ src/authentication.ts
@@ -110,7 +110,7 @@ export async function authenticate(options?: AuthenticationOptions): Promise<Cre
: `ps x -o args | grep '${name}'`
try {
- const { stdout } = await exec(command)
+ const { stdout } = await exec(command, { shell: 'powershell' })
const [, port] = stdout.match(portRegex)!
const [, password] = stdout.match(passwordRegex)!
const [, pid] = stdout.match(pidRegex)!
My bad for not testing locally
Is this going to cause issues with non windows systems? Maybe a better option would be something like
|
Oh you're right about that, I believe a solution like you've proposed here is better. Thanks! |
Hi, any updates on this? Looking forward to merging it! |
WMIC is deprecated, and even removed on Windows 11 dev (not sure about beta/release)
Sorry, was busy with work. Just pushed changes, not exactly what I had in my comment because type issues were wonky. Is there a better way to run tests than running jest manually from cli? Seems like there should be a "test" package.json script |
Again, thank you so much for the changes. And yes, you're right, I should totally have a test package.json script for this, will add one. E: Looks like I had a change for exactly that locally, pushed to master in a901c14 |
Thank you so much for your work, I've released 5.3.1 with your patch https://www.npmjs.com/package/league-connect |
WMIC is deprecated, and even removed on Windows 11 dev (not sure about beta/release)