diff --git a/lib/wmic.js b/lib/wmic.js index c0b98b7..1a1e163 100644 --- a/lib/wmic.js +++ b/lib/wmic.js @@ -146,7 +146,7 @@ wmic.prototype.query = function (wql, namespace, callback) { if (os.dist.search(/ubuntu/i) === 0 || os.dist.search(/debian/i) === 0) { self.wmic = 'bin/wmic_ubuntu_x64'; - } else if (os.dist.search(/centos/i) === 0 || os.dist.search(/redhat/i) === 0) { + } else if (os.dist.search(/centos/i) === 0 || os.dist.search(/rhel/i) === 0) { self.wmic = 'bin/wmic_centos_x64'; } @@ -182,11 +182,12 @@ wmic.prototype._exec = function (callback) { var result = []; var keys = []; + var lines = ""; rl.on('line', function (line) { if (line.length === 0 || line.indexOf('CLASS: ') === 0) return; - var item = line.toString().trim().split(self.parserOptions.delimiter); + var item = (lines + line).toString().trim().split(self.parserOptions.delimiter); if (self.parserOptions.trim === true) { item = item.map(function (v) { @@ -208,6 +209,9 @@ wmic.prototype._exec = function (callback) { }); result.push(obj); + lines = ""; + } else { + lines = lines + "\r\n" + line; } });