start-wuscan cmdlet is not avialble to run on few Windows 10

vasu M 6 Reputation points
2020-12-28T10:43:07.417+00:00

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

51593-image.png

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,351 questions
{count} vote

4 answers

Sort by: Most helpful
  1. Ben Rosenqvist 21 Reputation points
    2021-12-02T11:44:36.343+00:00

    Please bring back the "WindowsUpdateProvider" module

    4 people found this answer helpful.
    0 comments No comments

  2. abbodi86 3,776 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-648125918

    you 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
    
    2 people found this answer helpful.
    0 comments No comments

  3. MotoX80 31,556 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*).ExportedCommands

    Key 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

    0 comments No comments

  4. Ian Xue (Shanghai Wicresoft Co., Ltd.) 29,476 Reputation points Microsoft Vendor
    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.

    0 comments No comments