powerShell() Windows 7 fix compatibility issues (windows)

This commit is contained in:
Sebastian Hildebrandt
2025-12-29 15:33:38 +01:00
parent d7c1fd8aa7
commit 94aa730f88
5 changed files with 5 additions and 3 deletions
+1
View File
@@ -195,6 +195,7 @@ function fsSize(drive, callback) {
resolve(data);
} else {
exec('df -kPT 2>/dev/null', { maxBuffer: 1024 * 1024 }, (error, stdout) => {
// fixed issue alpine fallback
const lines = filterLines(stdout);
data = parseDf(lines);
if (callback) {
+1
View File
@@ -509,6 +509,7 @@ function powerShell(cmd) {
process.nextTick(() => {
try {
const osVersion = os.release().split('.').map(Number);
// windows 7 compatibility issue
const spanOptions =
osVersion[0] < 10
? ['-NoProfile', '-NoLogo', '-InputFormat', 'Text', '-NoExit', '-ExecutionPolicy', 'Unrestricted', '-Command', '-']