Menu

[ea00bd]: / util-winPatches / Start-Win10UpdateAssistant.PS1  Maximize  Restore  History

Download this file

42 lines (31 with data), 1.9 kB

#
# Author: David Yoder
# Initially: 2019-01-27
# Via: MSP Slack: https://join.slack.com/t/ninjarmm-colab/shared_invite/enQtNTI4Mjk5NTIwMzI3LTBmMGU2NDUwMjlhNDdlMzMyNDhiM2JlOTdkYzM5NGEwMWQ1ZGMwMzMzZTliMDcyM2E2YmNhNmY2MDAyZDJhN2M
#

## Make sure the computer is running Windows 10
If ( ([System.Environment]::OSVersion.Version).Major -ge 10 ) {

    ## Make sure the endpoint isn't already running 1809
    If ( ([System.Environment]::OSVersion.Version).Build -lt 17763 ) {
        
        ## Set the directory where the Windows Update Assistant will be downloaded to
        $DOWNLOADS = "${Env:TEMP}"

        ## URL to the latest version of the Windows Update Assistant
        $URL = 'https://download.microsoft.com/download/9/4/E/94E04254-741B-4316-B1DF-8CAEDF2DF16C/Windows10Upgrade9252.exe'

        ## Uninstall previous Windows 10 Update Assistant
        If ( Test-Path "${Env:SystemDrive}\Windows10Upgrade\Windows10UpgraderApp.exe" )
        { Start-Process "${Env:SystemDrive}\Windows10Upgrade\Windows10UpgraderApp.exe" -ArgumentList '/ForceUninstall' -Wait }

        ## Create download directory
        If (!( Test-Path $DOWNLOADS ))
        { New-Item -ItemType Directory -Path $DOWNLOADS }

        ## Download Windows 10 Update Assistant
        $FILENAME = Split-Path $URL -leaf
        If (!( Test-Path "${DOWNLOADS}\${FILENAME}" ))
        { (New-Object System.Net.WebClient).DownloadFile($URL,"${DOWNLOADS}\${FILENAME}") }

        ## Install and run the Windows 10 Update Assistant
        If ( Test-Path "${DOWNLOADS}\${FILENAME}" )
        { Start-Process -FilePath "${DOWNLOADS}\${FILENAME}" -Wait }

        ## Delete the downloaded program
        If ( Test-Path "${DOWNLOADS}\${FILENAME}" )
        { Remove-Item "${DOWNLOADS}\${FILENAME}" }

    } Else { Write-Host "This endpoint is already running Windows 10 1809." }

} Else { Write-Host "This endpoint is not running Windows 10." }
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.