From 81572e3d757ca451f2d69a16d3e2c9d013da9a9a Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Sun, 14 Apr 2024 15:40:10 +0300 Subject: [PATCH] Update Download_Sophia.ps1 --- Download_Sophia.ps1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Download_Sophia.ps1 b/Download_Sophia.ps1 index 6f1e6696..16b06c40 100644 --- a/Download_Sophia.ps1 +++ b/Download_Sophia.ps1 @@ -154,6 +154,23 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber) } Invoke-WebRequest @Parameters +if (Test-Path -Path "$DownloadsFolder\Sophia.Script.zip") +{ + continue +} +else +{ + Write-Verbose -Message "Your Windows build is unsupported. Run Windows Update and try again." -Verbose + + # Check for updates + Start-Process -FilePath "$env:SystemRoot\System32\UsoClient.exe" -ArgumentList StartInteractiveScan + + # Open the "Windows Update" page + Start-Process -FilePath "ms-settings:windowsupdate" + + return +} + $Parameters = @{ Path = "$DownloadsFolder\Sophia.Script.zip" DestinationPath = "$DownloadsFolder"