diff --git a/functions/public/Invoke-WPFButton.ps1 b/functions/public/Invoke-WPFButton.ps1
index 0b79e553..f2e528fb 100644
--- a/functions/public/Invoke-WPFButton.ps1
+++ b/functions/public/Invoke-WPFButton.ps1
@@ -61,5 +61,6 @@ function Invoke-WPFButton {
"WPFWinUtilInstallPSProfile" {Invoke-WinUtilInstallPSProfile}
"WPFWinUtilUninstallPSProfile" {Invoke-WinUtilUninstallPSProfile}
"WPFWinUtilSSHServer" {Invoke-WPFSSHServer}
+ "WPFScanUpdates" {Invoke-WPFScanUpdates}
}
}
diff --git a/functions/public/Invoke-WPFScanUpdates.ps1 b/functions/public/Invoke-WPFScanUpdates.ps1
new file mode 100644
index 00000000..cb41532c
--- /dev/null
+++ b/functions/public/Invoke-WPFScanUpdates.ps1
@@ -0,0 +1,50 @@
+function Invoke-WPFScanUpdates {
+
+
+ Invoke-WPFRunspace -DebugPreference $DebugPreference -ScriptBlock {
+ # Check if the PSWindowsUpdate module is installed
+ if (-not (Get-Module -ListAvailable -Name PSWindowsUpdate)) {
+ try {
+ Write-Host "PSWindowsUpdate module not found. Attempting to install..."
+ Install-Module -Name PSWindowsUpdate -Force -Scope CurrentUser
+ Write-Host "PSWindowsUpdate module installed successfully."
+ }
+ catch {
+ Write-Error "Failed to install PSWindowsUpdate module: $_"
+ return
+ }
+ }
+
+ # Import the module
+ try {
+ Import-Module PSWindowsUpdate -ErrorAction Stop
+ Write-Host "PSWindowsUpdate module imported successfully."
+ }
+ catch {
+ Write-Error "Failed to import PSWindowsUpdate module: $_"
+ return
+ }
+
+ try {
+ Write-Host "Clearing updates list..."
+ $sync.form.Dispatcher.Invoke([action] { $sync["WPFUpdatesList"].Items.Clear() })
+ Write-Host "Scanning for Windows updates..."
+ $updates = Get-WindowsUpdate -ErrorAction Stop
+ Write-Host "Found $($updates.Count) updates."
+
+ $sync.form.Dispatcher.Invoke([action] {
+ foreach ($update in $updates) {
+ $item = New-Object PSObject -Property @{
+ KB = $update.KB
+ Size = $update.Size
+ Title = $update.Title -replace '\s*\(KB\d+\)', '' -replace '\s*KB\d+\b', '' # Remove KB number from title, first in parentheses, then standalone
+ Status = "Not Installed"
+ }
+ $sync["WPFUpdatesList"].Items.Add($item)
+ }
+ })
+ } catch {
+ Write-Error "Error scanning for updates: $_"
+ }
+ }
+}
diff --git a/xaml/inputXML.xaml b/xaml/inputXML.xaml
index 63a41af5..b2518869 100644
--- a/xaml/inputXML.xaml
+++ b/xaml/inputXML.xaml
@@ -842,6 +842,182 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1135,95 +1311,103 @@
-
-
+
+
-
-
-
+
-
-
-
+
+
+
+
-
- Default Windows Update Configuration
-
- - No modifications to Windows defaults
-
- - Removes any custom update settings
-
- Note: This resets your Windows Update settings to default out of the box settings. It removes ANY policy or customization that has been done to Windows Update.
-
-
-
+ Content="Default"
+ Width="Auto"
+ Margin="0,2"
+ ToolTip="Default Windows Update Configuration
- No modifications to Windows defaults
- Removes any custom update settings
Note: This resets your Windows Update settings to default out of the box settings. It removes ANY policy or customization that has been done to Windows Update."/>
-
-
-
-
- Balanced Security Configuration
-
- - Feature updates delayed by 2 years
-
- - Security updates installed after 4 days
-
- Feature Updates: New features and potential bugs
-
- Security Updates: Critical security patches
-
- Note: This only applies to Pro systems that can use group policy.
-
-
-
+ Content="Security"
+ Width="Auto"
+ Margin="0,2"
+ ToolTip="Balanced Security Configuration
- Feature updates delayed by 2 years
- Security updates installed after 4 days
Feature Updates: New features and potential bugs
Security Updates: Critical security patches
Note: This only applies to Pro systems that can use group policy."/>
-
-
-
-
- !! Not Recommended !!
-
- - Disables ALL Windows Updates
-
- - Increases security risks
-
- - Only use for isolated systems
-
- Warning: Your system will be vulnerable without security updates.
-
+ Margin="0,2"
+ ToolTip="!! Not Recommended !!
- Disables ALL Windows Updates
- Increases security risks
- Only use for isolated systems
Warning: Your system will be vulnerable without security updates."/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+ Note: Updates may require a system restart to complete installation. Make sure to save any work before proceeding.
+
+
+