From f974af52c8717d4b45e863fec3c50c21672e7fba Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Tue, 2 Apr 2024 23:09:55 +0300 Subject: [PATCH] Update Download_Sophia.ps1 --- Download_Sophia.ps1 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Download_Sophia.ps1 b/Download_Sophia.ps1 index 06f32be4..0c41f78b 100644 --- a/Download_Sophia.ps1 +++ b/Download_Sophia.ps1 @@ -54,7 +54,16 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber) else { Write-Verbose -Message "Windows version is not supported. Update your Windows" -Verbose + + # Receive updates for other Microsoft products when you update Windows + (New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "") + + # Check for updates + Start-Process -FilePath "$env:SystemRoot\System32\UsoClient.exe" -ArgumentList StartInteractiveScan + + # Open the "Windows Update" page Start-Process -FilePath "ms-settings:windowsupdate" + exit } } @@ -75,7 +84,16 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber) else { Write-Verbose -Message "Windows version is not supported. Update your Windows" -Verbose + + # Receive updates for other Microsoft products when you update Windows + (New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "") + + # Check for updates + Start-Process -FilePath "$env:SystemRoot\System32\UsoClient.exe" -ArgumentList StartInteractiveScan + + # Open the "Windows Update" page Start-Process -FilePath "ms-settings:windowsupdate" + exit } }