Update Windows 10 scripted action issues

I've opened a ticket with Nerdio support (through Pax8 reseller) but also wanted to check if anyone else is noticing this issue. We have a monthly power off & set as image task scheduled against the desktop image that has a scripted action group assigned. One of the tasks in the scripted action group is running the "Update Windows 10" script from NMM github repo. 

The Nerdio task logs indicate successful installation of Windows updates, but if you power on the desktop image VM the next day and manually check for updates, the same updates that Nerdio logs reported were installed, are pending installation. Example screenshots below.

Is anyone else seeing this?


Comments (3 comments)

Marcos Artiaga

Hi Brian!
My name is Marcos and I'm one of the Sales Engineers here at Nerdio. I worked with another partner on this very issue a few weeks ago. The issue is that the script, as written, installs all of the available updates but doesn't check again after reboot. I've modified the script a bit to take this into consideration. By adding the "-recursecycle" switch and setting the number of times I want the script to check again for updates, it should help with this. I'll post my sample script below. Let me know if this works for you. You can set any number of retries that you want. I set mine to 5.

#description: Installs latest Windows 10 updates
#execution mode: IndividualWithRestart
#tags: Nerdio
This script will install ALL Windows updates using PSWindowsUpdate
See: https://www.powershellgallery.com/packages/PSWindowsUpdate for details on
how to customize and use the module for your needs.

# Ensure PSWindowsUpdate is installed on the system.
if(!(Get-installedmodule PSWindowsUpdate)){

    # Ensure NuGet and PowershellGet are installed on system
    Install-PackageProvider -Name NuGet -MinimumVersion -Force
    Install-Module PowershellGet -Force

    # Install latest version of PSWindowsUpdate
    Install-Module PSWindowsUpdate -Force
Import-Module PSWindowsUpdate -Force

# Initiate download and install of all pending Windows updates
Install-WindowsUpdate -AcceptAll -ForceInstall -IgnoreReboot -RecurseCycle 5

Brian Mock

Thanks for the help, Marcos. At first it didn't seem to help by adding the "-recursecycle" switch. I added the switch, ran the script during power off/set as image, but the same updates that Nerdio logs reported were installed, were still reporting pending installation when manually checking while logged into the image VM. However, I changed the “Target VM” setting on the power off/set as image schedule from “Clone” to “Source”. That change, in addition to the recursecycle seems to have resolved the issue.

Travis Lamming

Can we get this updated script, alongside what Brian changed into production? 


Please sign in to leave a comment.