none
Update and Restart Windows 10 Feature Update vs Normal Updates via PowerShell RRS feed

  • Question

  • Hey Guys,

    Looking for a way to programatically trigger the completion of a Windows 10 Feature update. 

    New feature was added to Windows 10 that allows users to either "Restart" or "Update and Restart". Normally used programmatic methods of triggering reboot (shutdown /r) will trigger "Update and Reboot" for normal updates, however, for feature updates (1709) the completion of the update is not triggered. I have also tried using the Reboot CSP via the WMI class found in 'root/cimv2/mdm/dmmap'. While I am successfully able to schedule a reboot utilizing the MDM_Reboot_Schedule01 class (code below), it still does not trigger the completion of the feature update. Does anyone have any ideas of how this could possibly be accomplished through PowerShell? Any help would be greatly appreciated!

    $session = New-CimSession
    $namespaceName = "root/cimv2/mdm/dmmap"
    $className = "MDM_Reboot_Schedule01"
    $getInstance = New-Object Microsoft.Management.Infrastructure.CimInstance $className, $namespaceName
    $getInstance.CimInstanceProperties.Add([Microsoft.Management.Infrastructure.CimProperty]::Create("ParentID", "./Vendor/MSFT/Reboot", "string", "Key"))
    $getInstance.CimInstanceProperties.Add([Microsoft.Management.Infrastructure.CimProperty]::Create("InstanceID", "Schedule", "String", "Key"))
    $updateInstance = $session.GetInstance($namespaceName, $getInstance, $null)
    $updateInstance.Single = $(Get-Date).AddSeconds(5).ToString("o")
    $session.ModifyInstance($namespaceName, $updateInstance, $null)
    Remove-CimSession $session

    Wednesday, May 9, 2018 4:49 PM