给powershell命令增加-NoProfile参数

This commit is contained in:
fofolee 2019-05-08 17:41:12 +08:00
parent dedc91f2d7
commit b9ede9c60f
2 changed files with 6 additions and 2 deletions

View File

@ -29,7 +29,7 @@ getIco = isWin ? require('icon-extractor') : require('file-icon');
totalMem = os.totalmem();
powershell = (cmd, callback) => {
const ps = spawn('powershell', ['-Command', cmd], { encoding: 'buffer' })
const ps = spawn('powershell', ['-NoProfile', '-Command', cmd], { encoding: 'buffer' })
let chunks = [];
let err_chunks = [];
ps.stdout.on('data', chunk => {
@ -89,3 +89,7 @@ taskkill = (task, path, callback) => {
});
}
}
tasklist(l => {
console.log(l);
})

Binary file not shown.