From 3961ed49915a814252f1345afb4ce27a3edadcb2 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 24 Jan 2026 04:08:41 +0000 Subject: [PATCH] feat: Optimize SoftwareLicensingProduct query Replaced the inefficient `Get-CimInstance | Where-Object` pipeline with a more performant `Get-CimInstance -Filter` call. The original script retrieved all SoftwareLicensingProduct instances and then filtered them in PowerShell. This change pushes the filtering logic down to the WMI service itself, which is significantly faster as it reduces the amount of data transferred. --- App/MAS_GUI.ps1 | 2 +- Run_GUI.cmd | 0 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 Run_GUI.cmd diff --git a/App/MAS_GUI.ps1 b/App/MAS_GUI.ps1 index 8d3672e..628a30a 100644 --- a/App/MAS_GUI.ps1 +++ b/App/MAS_GUI.ps1 @@ -31,7 +31,7 @@ function Get-SystemInfo { # Simple Activation Check (Partial) try { # 1=Licensed - $license = Get-CimInstance SoftwareLicensingProduct -ErrorAction SilentlyContinue | Where-Object { $_.PartialProductKey -and $_.Name -like "Windows*" } | Select-Object -First 1 + $license = Get-CimInstance SoftwareLicensingProduct -Filter "PartialProductKey IS NOT NULL AND Name LIKE 'Windows%'" -ErrorAction SilentlyContinue | Select-Object -First 1 $status = "Unknown / Check manually" if ($null -ne $license) { diff --git a/Run_GUI.cmd b/Run_GUI.cmd old mode 100644 new mode 100755