diff --git a/lib/disk.js b/lib/disk.js index fc5d52e..2c26557 100644 --- a/lib/disk.js +++ b/lib/disk.js @@ -40,26 +40,30 @@ switch(process.env.platform) { case 'win': module.exports = function(statEmitter, options) { - let wmic = 'wmic LOGICALDISK GET Name, Size, FreeSpace /value | findstr "FreeSpace Name Size"'; - exec(wmic, function(err, output, code) { + let powershell = 'powershell Get-CimInstance -ClassName Win32_LogicalDisk'; + exec(powershell, function(err, output, code) { if(err) return; let segments = output.split('\n'); - for(let i=0; i options.threshold) { - statEmitter.emit('disk', { filesystem: filesystem, usedpct: usedpct, total: total, free: free }); - } + for(let i=3; i options.threshold) { + statEmitter.emit('disk', { filesystem: filesystem, usedpct: usedpct, total: total, free: free }); } }