How to Automate Checking for Windows Updates?

Discussion in 'Windows 10' started by MrChris, Oct 18, 2018.

  1. MrChris

    MrChris MDL Addicted

    Jun 23, 2007
    532
    127
    30
    I am trying to find a simply/scriptable way to automate Checking and Applying Windows updates. I have been googing etc.. and it there are lots of options but the one I keep coming to is "Install-Module -Name PSWindowsUpdate" which prompts to install the module (Yes or No). When using this in a script its no bueno. Is there a simple way I can automate checking and applying any needed Windows Updates inside a script that does not require ANY user input?

    Regards,

    ~MC
     
  2. tonto11

    tonto11 MDL Addicted

    Jun 18, 2012
    612
    279
    30
    Why not set it up as a scheduled task to be run as often as you like
    and when it will not be a nuisance to your use of the computer

    ...T
     
  3. MrChris

    MrChris MDL Addicted

    Jun 23, 2007
    532
    127
    30
    What command do you recommend to use in the scheduled task?

    ~MC
     
  4. MrChris

    MrChris MDL Addicted

    Jun 23, 2007
    532
    127
    30
    Everything Iv tried so far confuses me as after I run the various commands when I check Windows Update section of Windows 10 its still says the last time checked was yesterday..
     
  5. kaljukass

    kaljukass MDL Guru

    Nov 26, 2012
    3,389
    1,321
    120
    What Windows it is what You have, is it really true that you do not get them automatically?
    Interestingly, for almost four years now, has been strong struggle to prevent Windows automatic updates and You looking for ways to get them ?!?
    Something is very deeply wrong!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. MrChris

    MrChris MDL Addicted

    Jun 23, 2007
    532
    127
    30
    Windows 10 Pro 1809. Sorry should have mentioned that.
     
  7. AveYo

    AveYo MDL Expert

    Feb 10, 2009
    1,836
    5,685
    60
    You have probably used some blocking solution in the past / butchered tasks etc. and should run Windows Update Troubleshooter
    usoclient StartScan
    usoclient StartInteractiveScan

    Should start a scan if everything is in order.
    You can add them as a batch script to startup, or create a scheduled task to run every 3 hours or whatever.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...