How to Automate Checking for Windows Updates?

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

  1. MrChris

    MrChris MDL Addicted

    Joined:
    Jun 23, 2007
    Messages:
    515
    Likes Received:
    120
    Trophy Points:
    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

    Joined:
    Jun 18, 2012
    Messages:
    612
    Likes Received:
    279
    Trophy Points:
    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

    Joined:
    Jun 23, 2007
    Messages:
    515
    Likes Received:
    120
    Trophy Points:
    30
    What command do you recommend to use in the scheduled task?

    ~MC
     
  4. MrChris

    MrChris MDL Addicted

    Joined:
    Jun 23, 2007
    Messages:
    515
    Likes Received:
    120
    Trophy Points:
    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

    Joined:
    Nov 26, 2012
    Messages:
    2,436
    Likes Received:
    883
    Trophy Points:
    90
    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!
     
  6. MrChris

    MrChris MDL Addicted

    Joined:
    Jun 23, 2007
    Messages:
    515
    Likes Received:
    120
    Trophy Points:
    30
    Windows 10 Pro 1809. Sorry should have mentioned that.
     
  7. BAU

    BAU MDL Addicted

    Joined:
    Feb 10, 2009
    Messages:
    943
    Likes Received:
    2,042
    Trophy Points:
    30
    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.
     
  8. sebus

    sebus MDL Guru

    Joined:
    Jul 23, 2008
    Messages:
    6,201
    Likes Received:
    1,945
    Trophy Points:
    210