Skip to content

Commit

Permalink
add Capacity Remaining
Browse files Browse the repository at this point in the history
Signed-off-by: si458 <simonsmith5521@gmail.com>
  • Loading branch information
si458 committed Feb 22, 2024
1 parent 26bb350 commit 0b2368d
Show file tree
Hide file tree
Showing 5 changed files with 1,809 additions and 1,788 deletions.
1 change: 1 addition & 0 deletions agents/meshcore.js
Expand Up @@ -5723,6 +5723,7 @@ function cleanGetBitLockerVolumeInfo(volumes) {
for (var i in volumes) {
const v = volumes[i];
if (typeof v.size == 'string') { v.size = parseInt(v.size); }
if (typeof v.sizeremaining == 'string') { v.sizeremaining = parseInt(v.sizeremaining); }
if (v.identifier == '') { delete v.identifier; }
if (v.name == '') { delete v.name; }
if (v.removable != true) { delete v.removable; }
Expand Down
5 changes: 3 additions & 2 deletions agents/modules_meshcore/computer-identifiers.js
Expand Up @@ -390,7 +390,7 @@ function windows_volumes()
p1.child = child;
child.promise = p1;
child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); });
child.stdin.write('Get-Volume | Select-Object -Property DriveLetter,FileSystemLabel,FileSystemType,Size,DriveType | ConvertTo-Csv -NoTypeInformation\nexit\n');
child.stdin.write('Get-Volume | Select-Object -Property DriveLetter,FileSystemLabel,FileSystemType,Size,SizeRemaining,DriveType | ConvertTo-Csv -NoTypeInformation\nexit\n');
child.on('exit', function (c)
{
var a, i, tokens, key;
Expand All @@ -407,7 +407,8 @@ function windows_volumes()
name: tokens[1].split('"')[1],
type: tokens[2].split('"')[1],
size: tokens[3].split('"')[1],
removable: tokens[4].split('"')[1] == 'Removable'
sizeremaining: tokens[4].split('"')[1],
removable: tokens[5].split('"')[1] == 'Removable'
};
}
}
Expand Down

0 comments on commit 0b2368d

Please sign in to comment.