Please bring back the "WindowsUpdateProvider" module
start-wuscan cmdlet is not avialble to run on few Windows 10
Hi,
We have few PCs where start-wuscan PowerShell cmdlet is not available to run. These PCs run 1909, 20H1, 20H2 builds. Wondering how is this cmdlet got broken or missing, and second how to restore it back ?
PS C:\WINDOWS\system32> start-wuscan
start-wuscan : The term 'start-wuscan' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
At line:1 char:1
- start-wuscan
- ~~~~~~~~~~~~
- CategoryInfo : ObjectNotFound: (start-wuscan:String) [], CommandNotFoundException
- FullyQualifiedErrorId : CommandNotFoundException
4 answers
Sort by: Most helpful
-
-
abbodi86 4,031 Reputation points
2020-12-28T22:13:13.77+00:00 The module is removed in version 2004 (20H1), and thus 20H2 too
https://github.com/MicrosoftDocs/windows-powershell-docs/issues/139#issuecomment-648125918you either have to rely on the manual commands to run the scan
e.g.$Session = new-object -com "Microsoft.Update.Session" $ctr = "(IsInstalled=0 and DeploymentAction=*) or (IsInstalled=1 and DeploymentAction=*) or (IsHidden=1 and DeploymentAction=*)" $Result = $Session.CreateupdateSearcher().Search($ctr).Updates $Result | Select Title,Identity,IsHidden,LastDeploymentChangeTime,KBArticleIDs | Format-List -Property Title,@{l='UpdateID';e={$_.Identity.UpdateID}},@{l='PublishedDate';e={$_.LastDeploymentChangeTime.ToString('yyyy-MM-dd')}},@{l='KBArticle';e={$_.KBArticleIDs}},IsHidden
or install external module PSWindowsUpdate
Install-PackageProvider -Name NuGet -Force Set-PSRepository -Name PSGallery -InstallationPolicy Trusted Install-Module -Name PSWindowsUpdate
-
MotoX80 35,626 Reputation points
2020-12-28T14:45:46.823+00:00 Check your $env:PSModulePath and verify that it contains C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
Verify that this file exists: C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\WindowsUpdateProvider\WindowsUpdateProvider.psd1
(get-module -ListAvailable windowsupdateprov*).path (get-module -ListAvailable windowsupdateprov*).ExportedCommands
PS C:\WINDOWS\system32> (get-module -ListAvailable windowsupdateprov*).path
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\WindowsUpdateProvider\WindowsUpdateProvider.psd1
PS C:\WINDOWS\system32> (get-module -ListAvailable windowsupdateprov*).ExportedCommandsKey Value
Get-WUAVersion Get-WUAVersion
Get-WULastInstallationDate Get-WULastInstallationDate
Get-WULastScanSuccessDate Get-WULastScanSuccessDate
Get-WUIsPendingReboot Get-WUIsPendingReboot
Install-WUUpdates Install-WUUpdates
Start-WUScan Start-WUScan -
Ian Xue-MSFT 40,901 Reputation points Microsoft External Staff
2020-12-29T07:53:32.203+00:00 Hi,
Check if the module WindowsUpdateProvider and the file C:\Windows\System32\WindowsPowerShell\v1.0\Modules\WindowsUpdateProvider\WindowsUpdateProvider.psd1 exist. If yes, please help to post the contents of the psd1 file.
Best Regards,
Ian Xue============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.