From f78f26322154da6c5bd401971af9318ab71c6a7c Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Tue, 16 Sep 2025 08:43:42 +0200 Subject: [PATCH] powershell: modifications --- README.md | 2 +- lib/util.js | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index cb8ef1d..f9c6ee3 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ ## The Systeminformation Project This is amazing. Started as a small project just for myself, it now has > 18,000 -lines of code, > 700 versions published, up to 9 mio downloads per month, > 380 +lines of code, > 700 versions published, up to 9 mio downloads per month, > 400 mio downloads overall. Top 10 NPM ranking for backend packages. Thank you to all who contributed to this project! diff --git a/lib/util.js b/lib/util.js index 2b2b6f3..7d63e43 100644 --- a/lib/util.js +++ b/lib/util.js @@ -490,7 +490,7 @@ function powerShell(cmd) { return new Promise((resolve) => { process.nextTick(() => { try { - const child = spawn(_powerShell, ['-NoProfile', '-NoLogo', '-InputFormat', 'Text', '-NoExit', '-ExecutionPolicy', 'Unrestricted', '-Command', '-'], { + const child = spawn(_powerShell, ['-NoProfile', '-NoLogo', '-InputFormat', 'Text', '-ExecutionPolicy', 'Unrestricted', '-Command', cmd], { stdio: 'pipe', windowsHide: true, maxBuffer: 1024 * 20000, @@ -520,14 +520,14 @@ function powerShell(cmd) { child.kill(); resolve(result); }); - try { - child.stdin.write(_psToUTF8 + cmd + os.EOL); - child.stdin.write('exit' + os.EOL); - child.stdin.end(); - } catch (e) { - child.kill(); - resolve(result); - } + // try { + // child.stdin.write(_psToUTF8 + cmd + os.EOL); + // child.stdin.write('exit' + os.EOL); + // child.stdin.end(); + // } catch (e) { + // child.kill(); + // resolve(result); + // } } else { resolve(result); }