Share via

What is the batch command to install all pending updates on a Windows server and what is its PowerShell equivalent?

Sudarsen Srinivasan 1 Reputation point
2022-11-23T08:32:54.363+00:00

What is the batch command to install all pending updates on a Windows server and what is its PowerShell equivalent?

All I find are scripts to install updates individually by providing the KB names etc. Also Powershell does not seem to have inbuild commands to search and install updates.

Please help.

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Server | User experience | Other

2 answers

Sort by: Most helpful
  1. Limitless Technology 45,231 Reputation points
    2022-11-24T11:11:36.967+00:00

    Hi. Thank you for your question and reaching out.

    Use these methods to check for and install updates using PowerShell:

    1. Launch Windows 11 Start.
    2. Right-click the first result from your search for PowerShell and choose "Run as administrator."
    3. To install the module to launch Windows Update, use the command shown below and press Enter.
      Install-Module PSWindowsUpdate
    4. To confirm, enter the letter A.
    5. To check for updates using PowerShell, type the following command and hit Enter:
      Get-WindowsUpdate
    6. To install the available Windows 10 updates, enter the command after typing it:
      Install-WindowsUpdate
    7. To confirm, enter the letter A.

    The most recent cumulative updates will download and install on your computer once you've finished the procedures.

    REFERENCE: https://pureinfotech.com/install-windows-10-update-powershell/

    ----------------------------------------------------------------------------------------------------------------------------

    If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.

    Was this answer helpful?

    0 comments No comments

  2. DaveK 1,871 Reputation points
    2022-11-23T09:28:28.027+00:00

    I've never found a reliable method for using PowerShell for Windows updates directly but I have had good success using a app called ABC-Update which is pretty customisable and works very well. I have a PowerShell script which runs monthly on my RDS servers to patch overnight and use PowerShell to parse the log output from ABC-Update and email my the logs if there are any errors.

    Might be worth checking ABC-Update to see if that suits what you need

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.