node compatibility fixes

This commit is contained in:
Sebastian Hildebrandt 2025-12-29 00:04:22 +01:00
parent 915588fd9d
commit f5e33bc69b

View File

@ -510,7 +510,7 @@ function powerShell(cmd) {
try {
const osVersion = os.release().split('.').map(Number);
const spanOptions =
osVersion[0] < 10
osVersion[0] < 0
? ['-NoProfile', '-NoLogo', '-InputFormat', 'Text', '-NoExit', '-ExecutionPolicy', 'Unrestricted', '-Command', '-']
: ['-NoProfile', '-NoLogo', '-InputFormat', 'Text', '-ExecutionPolicy', 'Unrestricted', '-Command', cmd];
const child = spawn(_powerShell, spanOptions, {
@ -543,7 +543,7 @@ function powerShell(cmd) {
child.kill();
resolve(result);
});
if (osVersion[0] < 10) {
if (osVersion[0] < 0) {
try {
child.stdin.write(_psToUTF8 + cmd + os.EOL);
child.stdin.write('exit' + os.EOL);