installedstoreapps console command
Signed-off-by: si458 <simonsmith5521@gmail.com>
si458 committed
Dec 24, 2025 at 10:23 UTC
dfb9dda4e29b836982dd20acc6a09d0adf30a85c
2 files changed
+30
-3
agents/meshcore.js
+10
-1
@@ -4052,7 +4052,7 @@ function processConsoleCommand(cmd, args, rights, sessionid) {
4052
if (bcdOK()) { availcommands += ',safemode'; }
4053
if (require('notifybar-desktop').DefaultPinned != null) { availcommands += ',privacybar'; }
4054
try { require('win-utils'); availcommands += ',taskbar'; } catch (ex) { }
4055
- try { require('win-info'); availcommands += ',installedapps,qfe,defender,av'; } catch (ex) { }
4055
+ try { require('win-info'); availcommands += ',installedapps,qfe,defender,av,installedstoreapps'; } catch (ex) { }
4056
}
4057
if (amt != null) { availcommands += ',amt,amtconfig,amtevents'; }
4058
if (process.platform != 'freebsd') { availcommands += ',vm'; }
@@ -5534,6 +5534,15 @@ function processConsoleCommand(cmd, args, rights, sessionid) {
5534
}
5535
break;
5536
}
5537
+ case 'installedstoreapps': {
5538
+ if(process.platform == 'win32'){
5539
+ var apps = require('win-info').installedStoreApps();
5540
+ if (apps[0]) {
5541
+ sendConsoleText(JSON.stringify(apps,null,1));
5542
+ };
5543
+ }
5544
+ break;
5545
+ }
5546
case 'qfe': {
5547
if(process.platform == 'win32'){
5548
var qfe = require('win-info').qfe();
agents/modules_meshcore/win-info.js
+20
-2
@@ -235,6 +235,24 @@ function installedApps()
235
return (ret);
236
}
237
238
+function installedStoreApps(){
239
+ try {
240
+ var tokens = require('win-wmi-fixed').query('ROOT\\CIMV2', 'SELECT * FROM Win32_InstalledStoreProgram');
241
+ if (tokens[0]){
242
+ for (var index = 0; index < tokens.length; index++) {
243
+ for (var key in tokens[index]) {
244
+ if (key.startsWith('__')) delete tokens[index][key];
245
+ }
246
+ }
247
+ return (tokens);
248
+ } else {
249
+ return ([]);
250
+ };
251
+ } catch (ex) {
252
+ return ([]);
253
+ }
254
+}
255
+
256
function defender(){
257
try {
258
var tokens = require('win-wmi').query('ROOT\\Microsoft\\Windows\\Defender', 'SELECT * FROM MSFT_MpComputerStatus', ['RealTimeProtectionEnabled','IsTamperProtected','AntivirusSignatureVersion','AntivirusSignatureLastUpdated']);
@@ -253,10 +271,10 @@ function defender(){
271
272
if (process.platform == 'win32')
273
{
256
- module.exports = { qfe: qfe, av: av, defrag: defrag, pendingReboot: pendingReboot, installedApps: installedApps, defender: defender };
274
+ module.exports = { qfe: qfe, av: av, defrag: defrag, pendingReboot: pendingReboot, installedApps: installedApps, installedStoreApps: installedStoreApps, defender: defender };
275
}
276
else
277
{
278
var not_supported = function () { throw (process.platform + ' not supported'); };
261
- module.exports = { qfe: not_supported, av: not_supported, defrag: not_supported, pendingReboot: not_supported, installedApps: not_supported, defender: not_supported };
279
+ module.exports = { qfe: not_supported, av: not_supported, defrag: not_supported, pendingReboot: not_supported, installedApps: not_supported, installedStoreApps: not_supported, defender: not_supported };
280
}
\ No newline at end of file