Replies: 1 comment
-
Concerns and challenges1. Execution timeWindows Update scans and installations can take anywhere from a few minutes to well over an hour, depending on the number and size of updates. This could make Windows gecko run significantly longer than expected, especially in deployment scenarios where execution time is critical (e.g., Windows Autopilot ESP phase). A 2-minute Windows gecko run that suddenly takes 45 minutes because of a cumulative update download would be unacceptable in most deployment scenarios. 2. Restart conflictsTriggering an update scan and download without enforcing a restart introduces complexity. If updates are installed but a restart is deferred, the device is left in a pending-reboot state. This can conflict with:
3. Synchronous vs. asynchronous executionIf Windows gecko waits for the update process to finish, execution time becomes unpredictable. If Windows gecko does not wait, the update process runs in the background and may conflict with other operations - registry changes, feature installations, or app deployments happening simultaneously. Neither option is ideal. 4. Timing and policy conflictsIn a Windows Autopilot deployment, Windows gecko typically runs early in the provisioning process. Triggering an update scan at this stage may happen before Windows Update policies are applied:
This could result in the device downloading and installing updates that should have been deferred, blocked, or managed by a specific update ring - leading to undesired behavior and potentially breaking the intended update management strategy. 5. Accidental feature update installationThis is perhaps the most critical concern. Without proper filtering or policy guardrails in place, triggering a Windows Update scan could inadvertently discover, download, and install a Windows 11 feature update - for example, upgrading a device from Windows 11 24H2 to 26H2. In a managed environment, feature update rollouts are carefully orchestrated through Windows Autopatch or Windows Update for Business deferral policies, controlling exactly when and which devices receive a new feature update. If Windows gecko triggers an update scan before these policies are applied - or if the scan bypasses policy because it runs outside the normal Windows Update orchestration - the device could:
This risk applies not only to feature updates but also to preview or optional updates that may appear in a scan result. The COM-based and In short, an uncontrolled update scan initiated by Windows gecko could silently undermine the entire Windows update management strategy. 6. Constrained Language Mode compatibilityThe COM-based approach ( 7. Error handling and reportingWindows Update operations can fail silently or produce errors that are difficult to interpret programmatically. Providing meaningful logging and error reporting within Windows gecko's CMTrace-compatible log format would be challenging, especially with the fire-and-forget approaches. Intermediate conclusionAfter evaluating the functionality, implementation approaches, and the challenges outlined above, the intermediate conclusion is that a windowsUpdate module is outside the scope of Windows gecko. Windows gecko is a desired state configuration tool - it sets sensible defaults and baselines quickly and predictably. Windows Update management is fundamentally different: it involves unpredictable execution times, external dependencies (update servers, bandwidth, content), restart orchestration, and tight integration with management policies like Windows Update for Business / Windows Autopatch. Adding update management to Windows gecko would:
Windows Update management is best left to the dedicated management stack (Microsoft Intune + Windows Update for Business / Windows Autopatch), where it can be controlled through policy, monitored for compliance, and orchestrated with proper restart management. This discussion remains open for community input. If there are scenarios where the above approach does not work, or if Microsoft introduces new APIs that address the timing and policy challenges, this decision can be revisited. If there is a specific need to trigger an update scan as a final step after provisioning, this is better handled as a standalone script deployed separately via Microsoft Intune - outside of the Windows gecko execution context - where timing and sequencing can be controlled independently. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Module proposal: windowsUpdate - Trigger Windows Update scan and download
Windows gecko is a desired state configuration tool, and the idea of a
windowsUpdatemodule has come up - a module that could trigger a Windows Update scan, download, and optionally install security updates and/or feature updates as part of a Windows gecko configuration run.The inspiration comes from the Windows Server Core
sconfigutility, which provides a simple menu-driven interface to scan for and install updates, with options to filter by update category (e.g., security updates only, all updates).Proposed functionality
The module would allow administrators to:
A conceptual configuration could look something like this:
{ "windowsUpdate": { "enabled": true, "dataset": [ { "description": "Scan and install security updates", "category": "SecurityUpdates", "action": "Install", "restartBehavior": "NoRestart" }, { "description": "Scan for feature updates only", "category": "FeatureUpdates", "action": "ScanOnly", "restartBehavior": "NoRestart" } ] } }PowerShell approaches for triggering Windows Update
There are several ways to interact with Windows Update from PowerShell 5.1. Below are examples of the most common approaches.
Approach 1: COM-based Windows Update Agent API
This is the most direct approach using the Windows Update Agent (WUA) COM objects, and it does not require any additional modules.
Approach 2: PSWindowsUpdate module
The
PSWindowsUpdatePowerShell module from the PowerShell Gallery provides a more user-friendly interface, but requires module installation.Approach 3: USOClient (Update Session Orchestrator)
A lightweight approach that triggers the built-in Update Session Orchestrator.
Note
USOClient.exeprovides no output or feedback. There is no way to determine what was scanned, downloaded, or installed, and no way to filter by update category. It is essentially a fire-and-forget approach.Approach 4: Windows Update WMI provider
Available in newer Windows versions via the MDM Bridge WMI Provider.
Related resources
Beta Was this translation helpful? Give feedback.
All reactions