mgajda83 / PSWindowsUpdate

This module contain cmdlets to manage Windows Update Client.
MIT License
305 stars 27 forks source link

Not worked on windows 11 #32

Open Montigomo opened 3 months ago

Montigomo commented 3 months ago
PS C:\Users\agite> Get-WindowsUpdate -Verbose
VERBOSE: AGIDESKTOP (26.07.2024 12:26:39): Connecting to Microsoft Update server. Please wait...
VERBOSE: Found [2] Updates in pre search criteria
VERBOSE: Found [2] Updates in post search criteria

ComputerName Status     KB          Size Title
------------ ------     --          ---- -----

PS C:\Users\agite>

but

image
PS C:\Users\agite> [System.Environment]::OSVersion.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      22631  0

PS C:\Users\agite> get-module pswindowsUpdate | select *

LogPipelineExecutionDetails : False
Name                        : pswindowsUpdate
Path                        : D:\_users\agite\Documents\PowerShell\Modules\pswindowsUpdate\2.2.1.5\PSWindowsUpdate.dll
ImplementingAssembly        : PSWindowsUpdate, Version=2.2.1.5, Culture=neutral, PublicKeyToken=null
Definition                  :
Description                 : This module contain cmdlets to manage Windows Update Client.
Guid                        : 8ed488ad-7c77-4b33-b06e-32214925163b
HelpInfoUri                 :
ModuleBase                  : D:\_users\agite\Documents\PowerShell\Modules\pswindowsUpdate\2.2.1.5
PrivateData                 : {[PSData, System.Collections.Hashtable]}
ExperimentalFeatures        : {}
Tags                        : {Microsoft, Windows, Update, Microsoft…}
ProjectUri                  : https://github.com/mgajda83/PSWindowsUpdate
IconUri                     :
LicenseUri                  : https://github.com/mgajda83/PSWindowsUpdate/blob/main/LICENSE
ReleaseNotes                :
                              v2.2.1  - Set-WUSettings added params to control TargetRelease for control Feature Updates version and Windows Update for Busines
                              s
                                        - Fixed Remove-WindowsUpdate bug
                                        - Fixed Get-WUHistory bug
                                        - Fixed Get-WindowsUpdate sendreport bug
                                        - Fixed Get-WindowsUpdate for Windows 11 H23H2 problem

                              v2.2.0  - New cmdlet Reset-WUComponents, for reset Windows Updates components to default
                                        - New cmdlet Get-WUOfflineMSU, for download offline msu package from microsoft Update Catalog

                              v2.1.1  - Remove-WindowsUpdate added WU Api uninstallation mode
                                        - Fixed bug with slow run cmdlets
                                        - Added support for Office 365 users to send emails

                              v2.1.0  - New cmdlet Set-PSWUSettings, for save PSWUSettings to xml file
                                        - Param -SendReport can use smtp server credentials
                                        - Install-WindowsUpdate added -RecurseCycle param, to install next updates after reboot
                                        - Install-WindowsUpdate added new pre search criteria: DeploymentAction, IsAssigned, IsPresent, BrowseOnly and AutoSelectOnWebS
                              ites
                                        - Change location of PSWindowsUpdate.log file to $Env:TEMP
                                        - Fixed Get-WULastResults bugs
                                        - Fixed Remove-WUServiceManager bugs

                              v2.0.0 - Rewrite whole script module to binary module

                              Cmdlets maping for old module:
                              v1.6.x                  => v2.0.x
                              Add-WUOfflineSync       => Add-WUServiceManager
                              Add-WUServiceManager    => Add-WUServiceManager
                              -                       => Enable-WURemoting
                              Get-WUHistory           => Get-WUHistory
                              Get-WUList              => Get-WindowsUpdate
                              Get-WUInstall           => Download-WindowsUpdate  (or Get-WindowsUpdate -Download)
                              Get-WUInstall           => Install-WindowsUpdate   (or Get-WindowsUpdate -Install)
                              Hide-WUUpdate           => Hide-WindowsUpdate      (or Get-WindowsUpdate -Hide)
                              Get-WUInstallerStatus   => Get-WUInstallerStatus
                              Get-WURebootStatus      => Get-WURebootStatus
                              Get-WUServiceManager    => Get-WUServiceManager
                              Get-WUUninstall         => Remove-WindowsUpdate
                              Invoke-WUInstall        => Invoke-WUJob
                              -                       => Get-WUJob
                              Remove-WUOfflineSync    => Remove-WUServiceManager
                              Remove-WUServiceManager => Remove-WUServiceManager
                              Get-WUAPIVersion        => Get-WUAPIVersion
                              Get-WULastResults       => Get-WULastResults
                              Start-WUDetectNow       => -
                              Start-WUService         => -
                              Get-WUSettings          => Get-WUSettings
                              Set-WUSettings          => Set-WUSettings
                              Update-WUModule         => Update-WUModule
RepositorySourceLocation    : https://www.powershellgallery.com/api/v2
Version                     : 2.2.1.5
ModuleType                  : Binary
Author                      : Michal Gajda
AccessMode                  : ReadWrite
ClrVersion                  :
CompanyName                 : Michal Gajda
Copyright                   : (c) 2011-2024 Michal Gajda. All rights reserved.
DotNetFrameworkVersion      : 4.5.1
ExportedFunctions           : {}
Prefix                      :
ExportedCmdlets             : {[Add-WUServiceManager, Add-WUServiceManager], [Enable-WURemoting, Enable-WURemoting], [Get-WindowsUpdate, Get-WindowsUpdate], [G
                              et-WUApiVersion, Get-WUApiVersion]…}
ExportedCommands            : {[Add-WUServiceManager, Add-WUServiceManager], [Enable-WURemoting, Enable-WURemoting], [Get-WindowsUpdate, Get-WindowsUpdate], [G
                              et-WUApiVersion, Get-WUApiVersion]…}
FileList                    : {D:\_users\agite\Documents\PowerShell\Modules\pswindowsUpdate\2.2.1.5\PSWindowsUpdate.dll, D:\_users\agite\Documents\PowerShell\M
                              odules\pswindowsUpdate\2.2.1.5\PSWindowsUpdate.dll-Help.xml, D:\_users\agite\Documents\PowerShell\Modules\pswindowsUpdate\2.2.1.5
                              \PSWindowsUpdate.Format.ps1xml, D:\_users\agite\Documents\PowerShell\Modules\pswindowsUpdate\2.2.1.5\PSWindowsUpdate.psd1…}
CompatiblePSEditions        : {Desktop}
ModuleList                  : {}
NestedModules               : {PSWindowsUpdate}
PowerShellHostName          :
PowerShellHostVersion       :
PowerShellVersion           : 5.1.0.0
ProcessorArchitecture       : None
Scripts                     : {}
RequiredAssemblies          : {}
RequiredModules             : {}
RootModule                  : PSWindowsUpdate.dll
ExportedVariables           : {}
ExportedAliases             : {[Clear-WUJob, Clear-WUJob], [Download-WindowsUpdate, Download-WindowsUpdate], [Get-WUInstall, Get-WUInstall], [Get-WUList, Get-W
                              UList]…}
ExportedDscResources        : {}
SessionState                : System.Management.Automation.SessionState
OnRemove                    :
ExportedFormatFiles         : {D:\_users\agite\Documents\PowerShell\Modules\pswindowsUpdate\2.2.1.5\PSWindowsUpdate.Format.ps1xml}
ExportedTypeFiles           : {}
plao commented 3 months ago

It's a Microsoft bug on Win11: https://learn.microsoft.com/en-us/windows/release-health/status-windows-11-23H2#the-june-2024-preview-update-might-impact-applications-using-windows-update-apis

Montigomo commented 3 months ago

Thanks for your reply, very useful module!!! I am using it for scheduled update of all windows PCs in one office via ssh session. Everything works perfectly!!!

plao commented 3 months ago

The issue seems to be solved after (forcibly, because was not proposed as update) applying this KB: July 25, 2024 (KB5040527). For me was helpful and after the reboot, all seems to work again.

Here's the link: https://catalog.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/92ac27d7-6832-4bac-8205-922458d3df2b/public/windows11.0-kb5040527-x64_4713766dc272c376bee6d39d39a84a85bcd7f1e7.msu