node compatibility fixes
This commit is contained in:
parent
f5e33bc69b
commit
4af416daa9
@ -510,7 +510,7 @@ function powerShell(cmd) {
|
||||
try {
|
||||
const osVersion = os.release().split('.').map(Number);
|
||||
const spanOptions =
|
||||
osVersion[0] < 0
|
||||
osVersion[0] < 10
|
||||
? ['-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] < 0) {
|
||||
if (osVersion[0] < 10) {
|
||||
try {
|
||||
child.stdin.write(_psToUTF8 + cmd + os.EOL);
|
||||
child.stdin.write('exit' + os.EOL);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user