diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 index 8081192f..303c4290 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 @@ -13,7 +13,7 @@ .NOTES Supported Windows 10 version Version: 1809 - Build: 17763.3406+ + Builds: 17763.3406+ Edition: Enterprise LTSC Architecture: x64 diff --git a/src/Sophia_Script_for_Windows_11/Localizations/de-DE/Sophia.psd1 b/src/Sophia_Script_for_Windows_11/Localizations/de-DE/Sophia.psd1 index 8c507ea4..5ab0044c 100644 --- a/src/Sophia_Script_for_Windows_11/Localizations/de-DE/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11/Localizations/de-DE/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = Das Skript unterstützt Windows 11 2004/20H2/21H1-Versionen und höher -UpdateWarning = Ihr Windows 11-Build: {0}.{1}. Unterstützter Builds: 22000.1335, 22621.963 und höher. Führen Sie Windows Update aus und versuchen Sie es erneut +UpdateWarning = Ihr Windows 11-Build: {0}.{1}. Unterstützter Builds: 22621.963 und höher. Führen Sie Windows Update aus und versuchen Sie es erneut UnsupportedLanguageMode = Die PowerShell-Sitzung wird in einem eingeschränkten Sprachmodus ausgeführt LoggedInUserNotAdmin = Der angemeldete Benutzer hat keine Administratorrechte UnsupportedPowerShell = Sie versuchen ein Skript über PowerShell {0}.{1} auszuführen. Das Skript in der entsprechenden PowerShell-Version ausführen diff --git a/src/Sophia_Script_for_Windows_11/Localizations/en-US/Sophia.psd1 b/src/Sophia_Script_for_Windows_11/Localizations/en-US/Sophia.psd1 index 57fada9d..c48f7184 100644 --- a/src/Sophia_Script_for_Windows_11/Localizations/en-US/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11/Localizations/en-US/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = The script supports Windows 11 21H2 version and higher -UpdateWarning = Your Windows 11 build: {0}.{1}. Supported builds: 22000.1335, 22621.963 and higher. Run Windows Update and try again +UpdateWarning = Your Windows 11 build: {0}.{1}. Supported builds: 22621.963 and higher. Run Windows Update and try again UnsupportedLanguageMode = The PowerShell session in running in a limited language mode LoggedInUserNotAdmin = The logged-on user doesn't have admin rights UnsupportedPowerShell = You're trying to run script via PowerShell {0}.{1}. Run the script in the appropriate PowerShell version diff --git a/src/Sophia_Script_for_Windows_11/Localizations/es-ES/Sophia.psd1 b/src/Sophia_Script_for_Windows_11/Localizations/es-ES/Sophia.psd1 index 2ce3c781..018d4c3d 100644 --- a/src/Sophia_Script_for_Windows_11/Localizations/es-ES/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11/Localizations/es-ES/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = El script es compatible con versión Windows 11 21H2 y superiores -UpdateWarning = Su build de Windows 11: {0}.{1}. Compilaciones compatibles: 22000.1335, 22621.963 y superiores. Ejecute Windows Update y vuelva a intentarlo +UpdateWarning = Su build de Windows 11: {0}.{1}. Compilaciones compatibles: 22621.963 y superiores. Ejecute Windows Update y vuelva a intentarlo UnsupportedLanguageMode = Sesión de PowerShell ejecutada en modo de lenguaje limitado LoggedInUserNotAdmin = El usuario que inició sesión no tiene derechos de administrador UnsupportedPowerShell = Estás intentando ejecutar el script a través de PowerShell {0}.{1}. Ejecute el script en la versión apropiada de PowerShell diff --git a/src/Sophia_Script_for_Windows_11/Localizations/fr-FR/Sophia.psd1 b/src/Sophia_Script_for_Windows_11/Localizations/fr-FR/Sophia.psd1 index c67e251e..18018ec1 100644 --- a/src/Sophia_Script_for_Windows_11/Localizations/fr-FR/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11/Localizations/fr-FR/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = Le script supporte les versions Windows 11 21H2 et ultérieures -UpdateWarning = Votre version de Windows 11 : {0}.{1}. Versions prises en charge: 22000.1335, 22621.963 et ultérieures. Exécutez Windows Update et réessayez +UpdateWarning = Votre version de Windows 11 : {0}.{1}. Versions prises en charge: 22621.963 et ultérieures. Exécutez Windows Update et réessayez UnsupportedLanguageMode = La session PowerShell s'exécute dans un mode de langue limité LoggedInUserNotAdmin = L'utilisateur connecté n'a pas de droits d'administrateur UnsupportedPowerShell = Vous essayez d'exécuter le script via PowerShell {0}.{1}. Exécutez le script dans la version appropriée de PowerShell diff --git a/src/Sophia_Script_for_Windows_11/Localizations/hu-HU/Sophia.psd1 b/src/Sophia_Script_for_Windows_11/Localizations/hu-HU/Sophia.psd1 index c1dadf40..e76b531c 100644 --- a/src/Sophia_Script_for_Windows_11/Localizations/hu-HU/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11/Localizations/hu-HU/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = A szkript a Windows 11 21H2 és újabb kiadásokat támogatja -UpdateWarning = Az Ön Windows 11 építése: {0}.{1}. Támogatott buildek: 22000.1335, 22621.963 és magasabb verziószámok. Futtassa a Windows Update programot, és próbálja meg újra +UpdateWarning = Az Ön Windows 11 építése: {0}.{1}. Támogatott buildek: 22621.963 és magasabb verziószámok. Futtassa a Windows Update programot, és próbálja meg újra UnsupportedLanguageMode = A PowerShell munkamenet korlátozott nyelvi üzemmódban fut LoggedInUserNotAdmin = A bejelentkezett felhasználó nem rendelkezik admin jogokkal UnsupportedPowerShell = A PowerShell {0}.{1} segítségével próbálja futtatni a szkriptet. Futtassa a szkriptet a megfelelő PowerShell-verzióban diff --git a/src/Sophia_Script_for_Windows_11/Localizations/it-IT/Sophia.psd1 b/src/Sophia_Script_for_Windows_11/Localizations/it-IT/Sophia.psd1 index 836bcd07..7654b22f 100644 --- a/src/Sophia_Script_for_Windows_11/Localizations/it-IT/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11/Localizations/it-IT/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = Lo script supporta Windows 11 21H2 e versioni successive -UpdateWarning = La tua build di Windows 11 {0}.{1} non è supportata. Build supportate: 22000.1335, 22621.963 e successive. Eseguire Windows Update e riprovare +UpdateWarning = La tua build di Windows 11 {0}.{1} non è supportata. Build supportate: 22621.963 e successive. Eseguire Windows Update e riprovare UnsupportedLanguageMode = La sessione PowerShell è in esecuzione in modalità lingua limitata LoggedInUserNotAdmin = L'utente in suo non ha i diritti di amministratore UnsupportedPowerShell = Stai cercando di eseguire lo script tramite PowerShell {0}.{1}. Esegui lo script nella versione di PowerShell appropriata diff --git a/src/Sophia_Script_for_Windows_11/Localizations/pl-PL/Sophia.psd1 b/src/Sophia_Script_for_Windows_11/Localizations/pl-PL/Sophia.psd1 index 85bff63b..beb0d952 100644 --- a/src/Sophia_Script_for_Windows_11/Localizations/pl-PL/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11/Localizations/pl-PL/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = Skrypt obsługuje tylko system Windows 11 21H2 version and higher -UpdateWarning = Twoja wersja systemu Windows 11: {0}.{1}. Obsługiwane kompilacje: 22000.1335, 22621.963 i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie. +UpdateWarning = Twoja wersja systemu Windows 11: {0}.{1}. Obsługiwane kompilacje: 22621.963 i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie. UnsupportedLanguageMode = Sesja PowerShell działa w trybie ograniczonego języka LoggedInUserNotAdmin = Zalogowany użytkownik nie posiada uprawnień administratora UnsupportedPowerShell = Próbujesz uruchomić skrypt przy użyciu PowerShell {0}.{1}. Uruchom skrypt używając odpowiedniej wersji PowerShell diff --git a/src/Sophia_Script_for_Windows_11/Localizations/pt-BR/Sophia.psd1 b/src/Sophia_Script_for_Windows_11/Localizations/pt-BR/Sophia.psd1 index 8219f757..29e9993e 100644 --- a/src/Sophia_Script_for_Windows_11/Localizations/pt-BR/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11/Localizations/pt-BR/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = O script suporta versões Windows 11 21H2 e superior -UpdateWarning = La tua build di Windows 11: {0}.{1}. Build suportadas: 22000.1335, 22621.963 e successive. Execute o Windows Update e tente novamente +UpdateWarning = La tua build di Windows 11: {0}.{1}. Build suportadas: 22621.963 e successive. Execute o Windows Update e tente novamente UnsupportedLanguageMode = A sessão PowerShell em funcionamento em um modo de linguagem limitada LoggedInUserNotAdmin = O usuário logado não tem direitos de administrador UnsupportedPowerShell = Você está tentando executar o script via PowerShell {0}.{1}. Execute o script na versão apropriada do PowerShell diff --git a/src/Sophia_Script_for_Windows_11/Localizations/ru-RU/Sophia.psd1 b/src/Sophia_Script_for_Windows_11/Localizations/ru-RU/Sophia.psd1 index 807bd817..294f57a2 100644 --- a/src/Sophia_Script_for_Windows_11/Localizations/ru-RU/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11/Localizations/ru-RU/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = Скрипт поддерживает только Windows 11 21H2 и выше -UpdateWarning = Ваш билд Windows 11: {0}.{1}. Поддерживаемые сборки: 22000.1335, 22621.963 и выше. Запустите обновление Windows и попробуйте заново +UpdateWarning = Ваш билд Windows 11: {0}.{1}. Поддерживаемые сборки: 22621.963 и выше. Запустите обновление Windows и попробуйте заново UnsupportedLanguageMode = Сессия PowerShell работает в ограниченном режиме LoggedInUserNotAdmin = Текущий вошедший пользователь не обладает правами администратора UnsupportedPowerShell = Вы пытаетесь запустить скрипт в PowerShell {0}.{1}. Запустите скрипт в соответствующей версии PowerShell diff --git a/src/Sophia_Script_for_Windows_11/Localizations/tr-TR/Sophia.psd1 b/src/Sophia_Script_for_Windows_11/Localizations/tr-TR/Sophia.psd1 index 2d02555a..016d290f 100644 --- a/src/Sophia_Script_for_Windows_11/Localizations/tr-TR/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11/Localizations/tr-TR/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = Bu betik sadece Windows 11 21H2 sürüm ve üstünü destekliyor -UpdateWarning = Windows 11 yapınız: {0}.{1}. Desteklenen yapılar: 22000.1335, 22621.963 ve üstünü destekliyor. Windows Update'i çalıştırın ve tekrar deneyin +UpdateWarning = Windows 11 yapınız: {0}.{1}. Desteklenen yapılar: 22621.963 ve üstünü destekliyor. Windows Update'i çalıştırın ve tekrar deneyin UnsupportedLanguageMode = Sınırlı bir dil modunda çalışan PowerShell oturumu LoggedInUserNotAdmin = Oturum açan kullanıcının yönetici hakları yok UnsupportedPowerShell = Komut dosyasını PowerShell {0}.{1} aracılığıyla çalıştırmaya çalışıyorsunuz. Komut dosyasını uygun PowerShell sürümünde çalıştırın diff --git a/src/Sophia_Script_for_Windows_11/Localizations/uk-UA/Sophia.psd1 b/src/Sophia_Script_for_Windows_11/Localizations/uk-UA/Sophia.psd1 index bac02929..76699320 100644 --- a/src/Sophia_Script_for_Windows_11/Localizations/uk-UA/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11/Localizations/uk-UA/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = Скрипт підтримує тільки Windows 11 21H2 та вище -UpdateWarning = Ваш білд Windows 11: {0}.{1}. Підтримувані збірки: 22000.1335, 22621.963 та вище. Запустіть Windows Update і повторіть спробу +UpdateWarning = Ваш білд Windows 11: {0}.{1}. Підтримувані збірки: 22621.963 та вище. Запустіть Windows Update і повторіть спробу UnsupportedLanguageMode = Сесія PowerShell працює в обмеженому режимі LoggedInUserNotAdmin = Поточний користувач, що увійшов, не має прав адміністратора UnsupportedPowerShell = Ви намагаєтеся запустити скрипт в PowerShell {0}.{1}. Запустіть скрипт у відповідній версії PowerShell diff --git a/src/Sophia_Script_for_Windows_11/Localizations/zh-CN/Sophia.psd1 b/src/Sophia_Script_for_Windows_11/Localizations/zh-CN/Sophia.psd1 index bbb1c210..4ef87048 100644 --- a/src/Sophia_Script_for_Windows_11/Localizations/zh-CN/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11/Localizations/zh-CN/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = 该脚本支持Windows 11版本21H2和更高版本 -UpdateWarning = 您的Windows 11构建: {0}.{1}。支持的构建: 22000.1335, 22621.963和更高版本。运行Windows Update并再次尝试 +UpdateWarning = 您的Windows 11构建: {0}.{1}。支持的构建: 22621.963和更高版本。运行Windows Update并再次尝试 UnsupportedLanguageMode = PowerShell会话在有限的语言模式下运行 LoggedInUserNotAdmin = 登录的用户没有管理员的权利 UnsupportedPowerShell = 你想通过PowerShell {0}.{1}运行脚本。在适当的PowerShell版本中运行该脚本 diff --git a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 index 177e91f0..4d3c5e4f 100644 --- a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 @@ -13,7 +13,7 @@ .NOTES Supported Windows 11 versions Versions: 21H2/22H2/23H2+ - Builds: 22000.1335+, 22621.963+ + Builds: 22621.963+ Editions: Home/Pro/Enterprise .LINK GitHub @@ -60,38 +60,64 @@ function Checks { {$_ -eq 22000} { - if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -lt 1335) - { - # Check whether the OS minor build version is 1335 minimum - # https://docs.microsoft.com/en-us/windows/release-health/windows11-release-information - $CurrentBuild = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name CurrentBuild - $UBR = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR + # Download PC Health Check app + $DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" + $Parameters = @{ + Uri = "https://aka.ms/GetPCHealthCheckApp" + OutFile = "$DownloadsFolder\WindowsPCHealthCheckSetup.msi" + UseBasicParsing = $true + Verbose = $true + } + Invoke-WebRequest @Parameters - Write-Warning -Message ($Localization.UpdateWarning -f $CurrentBuild.CurrentBuild, $UBR.UBR) + # Extract WindowsPCHealthCheckSetup.msi without installing + $Arguments = @( + "/a `"$DownloadsFolder\WindowsPCHealthCheckSetup.msi`"", + "TARGETDIR=`"$DownloadsFolder\WindowsPCHealthCheckSetup`"", + "/qb" + ) + Start-Process -FilePath "msiexec" -ArgumentList $Arguments -Wait + Remove-Item -Path "$DownloadsFolder\WindowsPCHealthCheckSetup.msi" -Force + Start-Process -FilePath "$DownloadsFolder\WindowsPCHealthCheckSetup\PCHealthCheck\PCHealthCheck.exe" - Start-Process -FilePath "https://t.me/sophia_chat" + # Download Windows 11 Installation Assistant + # https://www.microsoft.com/software-download/windows11 + $DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" + $Parameters = @{ + Uri = "https://go.microsoft.com/fwlink/?linkid=2171764" + OutFile = "$DownloadsFolder\Windows11InstallationAssistant.exe" + UseBasicParsing = $true + Verbose = $true + } + Invoke-WebRequest @Parameters + Start-Process -FilePath "$DownloadsFolder\Windows11InstallationAssistant.exe" -ArgumentList "/SkipEULA" - # Enable receiving updates for other Microsoft products when you update Windows - (New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "") + $CurrentBuild = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name CurrentBuild + $UBR = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR + Write-Warning -Message ($Localization.UpdateWarning -f $CurrentBuild.CurrentBuild, $UBR.UBR) - Start-Sleep -Seconds 1 + Start-Process -FilePath "https://t.me/sophia_chat" - # Check for UWP apps updates - Get-CimInstance -Namespace root/CIMV2/mdm/dmmap -ClassName MDM_EnterpriseModernAppManagement_AppManagement01 | Invoke-CimMethod -MethodName UpdateScanMethod + # Enable receiving updates for other Microsoft products when you update Windows + (New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "") - # Open the "Windows Update" page - Start-Process -FilePath "ms-settings:windowsupdate" + Start-Sleep -Seconds 1 - # Check for updates - Start-Process -FilePath "ms-settings:windowsupdate-action" + # Check for UWP apps updates + Get-CimInstance -Namespace root/CIMV2/mdm/dmmap -ClassName MDM_EnterpriseModernAppManagement_AppManagement01 | Invoke-CimMethod -MethodName UpdateScanMethod - Start-Sleep -Seconds 1 + # Open the "Windows Update" page + Start-Process -FilePath "ms-settings:windowsupdate" - # Trigger Windows Update for detecting new updates - (New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow() + # Check for updates + Start-Process -FilePath "ms-settings:windowsupdate-action" - exit - } + Start-Sleep -Seconds 1 + + # Trigger Windows Update for detecting new updates + (New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow() + + exit } {$_ -ge 22621} { @@ -101,7 +127,6 @@ function Checks # https://docs.microsoft.com/en-us/windows/release-health/windows11-release-information $CurrentBuild = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name CurrentBuild $UBR = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR - Write-Warning -Message ($Localization.UpdateWarning -f $CurrentBuild.CurrentBuild, $UBR.UBR) Start-Process -FilePath "https://t.me/sophia_chat" diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/de-DE/Sophia.psd1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/de-DE/Sophia.psd1 index 8c507ea4..5ab0044c 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/de-DE/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/de-DE/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = Das Skript unterstützt Windows 11 2004/20H2/21H1-Versionen und höher -UpdateWarning = Ihr Windows 11-Build: {0}.{1}. Unterstützter Builds: 22000.1335, 22621.963 und höher. Führen Sie Windows Update aus und versuchen Sie es erneut +UpdateWarning = Ihr Windows 11-Build: {0}.{1}. Unterstützter Builds: 22621.963 und höher. Führen Sie Windows Update aus und versuchen Sie es erneut UnsupportedLanguageMode = Die PowerShell-Sitzung wird in einem eingeschränkten Sprachmodus ausgeführt LoggedInUserNotAdmin = Der angemeldete Benutzer hat keine Administratorrechte UnsupportedPowerShell = Sie versuchen ein Skript über PowerShell {0}.{1} auszuführen. Das Skript in der entsprechenden PowerShell-Version ausführen diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/en-US/Sophia.psd1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/en-US/Sophia.psd1 index 57fada9d..c48f7184 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/en-US/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/en-US/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = The script supports Windows 11 21H2 version and higher -UpdateWarning = Your Windows 11 build: {0}.{1}. Supported builds: 22000.1335, 22621.963 and higher. Run Windows Update and try again +UpdateWarning = Your Windows 11 build: {0}.{1}. Supported builds: 22621.963 and higher. Run Windows Update and try again UnsupportedLanguageMode = The PowerShell session in running in a limited language mode LoggedInUserNotAdmin = The logged-on user doesn't have admin rights UnsupportedPowerShell = You're trying to run script via PowerShell {0}.{1}. Run the script in the appropriate PowerShell version diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/es-ES/Sophia.psd1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/es-ES/Sophia.psd1 index 2ce3c781..018d4c3d 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/es-ES/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/es-ES/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = El script es compatible con versión Windows 11 21H2 y superiores -UpdateWarning = Su build de Windows 11: {0}.{1}. Compilaciones compatibles: 22000.1335, 22621.963 y superiores. Ejecute Windows Update y vuelva a intentarlo +UpdateWarning = Su build de Windows 11: {0}.{1}. Compilaciones compatibles: 22621.963 y superiores. Ejecute Windows Update y vuelva a intentarlo UnsupportedLanguageMode = Sesión de PowerShell ejecutada en modo de lenguaje limitado LoggedInUserNotAdmin = El usuario que inició sesión no tiene derechos de administrador UnsupportedPowerShell = Estás intentando ejecutar el script a través de PowerShell {0}.{1}. Ejecute el script en la versión apropiada de PowerShell diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/fr-FR/Sophia.psd1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/fr-FR/Sophia.psd1 index c67e251e..18018ec1 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/fr-FR/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/fr-FR/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = Le script supporte les versions Windows 11 21H2 et ultérieures -UpdateWarning = Votre version de Windows 11 : {0}.{1}. Versions prises en charge: 22000.1335, 22621.963 et ultérieures. Exécutez Windows Update et réessayez +UpdateWarning = Votre version de Windows 11 : {0}.{1}. Versions prises en charge: 22621.963 et ultérieures. Exécutez Windows Update et réessayez UnsupportedLanguageMode = La session PowerShell s'exécute dans un mode de langue limité LoggedInUserNotAdmin = L'utilisateur connecté n'a pas de droits d'administrateur UnsupportedPowerShell = Vous essayez d'exécuter le script via PowerShell {0}.{1}. Exécutez le script dans la version appropriée de PowerShell diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/hu-HU/Sophia.psd1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/hu-HU/Sophia.psd1 index c1dadf40..e76b531c 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/hu-HU/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/hu-HU/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = A szkript a Windows 11 21H2 és újabb kiadásokat támogatja -UpdateWarning = Az Ön Windows 11 építése: {0}.{1}. Támogatott buildek: 22000.1335, 22621.963 és magasabb verziószámok. Futtassa a Windows Update programot, és próbálja meg újra +UpdateWarning = Az Ön Windows 11 építése: {0}.{1}. Támogatott buildek: 22621.963 és magasabb verziószámok. Futtassa a Windows Update programot, és próbálja meg újra UnsupportedLanguageMode = A PowerShell munkamenet korlátozott nyelvi üzemmódban fut LoggedInUserNotAdmin = A bejelentkezett felhasználó nem rendelkezik admin jogokkal UnsupportedPowerShell = A PowerShell {0}.{1} segítségével próbálja futtatni a szkriptet. Futtassa a szkriptet a megfelelő PowerShell-verzióban diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/it-IT/Sophia.psd1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/it-IT/Sophia.psd1 index 836bcd07..7654b22f 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/it-IT/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/it-IT/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = Lo script supporta Windows 11 21H2 e versioni successive -UpdateWarning = La tua build di Windows 11 {0}.{1} non è supportata. Build supportate: 22000.1335, 22621.963 e successive. Eseguire Windows Update e riprovare +UpdateWarning = La tua build di Windows 11 {0}.{1} non è supportata. Build supportate: 22621.963 e successive. Eseguire Windows Update e riprovare UnsupportedLanguageMode = La sessione PowerShell è in esecuzione in modalità lingua limitata LoggedInUserNotAdmin = L'utente in suo non ha i diritti di amministratore UnsupportedPowerShell = Stai cercando di eseguire lo script tramite PowerShell {0}.{1}. Esegui lo script nella versione di PowerShell appropriata diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/pl-PL/Sophia.psd1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/pl-PL/Sophia.psd1 index 85bff63b..beb0d952 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/pl-PL/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/pl-PL/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = Skrypt obsługuje tylko system Windows 11 21H2 version and higher -UpdateWarning = Twoja wersja systemu Windows 11: {0}.{1}. Obsługiwane kompilacje: 22000.1335, 22621.963 i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie. +UpdateWarning = Twoja wersja systemu Windows 11: {0}.{1}. Obsługiwane kompilacje: 22621.963 i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie. UnsupportedLanguageMode = Sesja PowerShell działa w trybie ograniczonego języka LoggedInUserNotAdmin = Zalogowany użytkownik nie posiada uprawnień administratora UnsupportedPowerShell = Próbujesz uruchomić skrypt przy użyciu PowerShell {0}.{1}. Uruchom skrypt używając odpowiedniej wersji PowerShell diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/pt-BR/Sophia.psd1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/pt-BR/Sophia.psd1 index 8219f757..29e9993e 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/pt-BR/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/pt-BR/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = O script suporta versões Windows 11 21H2 e superior -UpdateWarning = La tua build di Windows 11: {0}.{1}. Build suportadas: 22000.1335, 22621.963 e successive. Execute o Windows Update e tente novamente +UpdateWarning = La tua build di Windows 11: {0}.{1}. Build suportadas: 22621.963 e successive. Execute o Windows Update e tente novamente UnsupportedLanguageMode = A sessão PowerShell em funcionamento em um modo de linguagem limitada LoggedInUserNotAdmin = O usuário logado não tem direitos de administrador UnsupportedPowerShell = Você está tentando executar o script via PowerShell {0}.{1}. Execute o script na versão apropriada do PowerShell diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/ru-RU/Sophia.psd1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/ru-RU/Sophia.psd1 index 807bd817..294f57a2 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/ru-RU/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/ru-RU/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = Скрипт поддерживает только Windows 11 21H2 и выше -UpdateWarning = Ваш билд Windows 11: {0}.{1}. Поддерживаемые сборки: 22000.1335, 22621.963 и выше. Запустите обновление Windows и попробуйте заново +UpdateWarning = Ваш билд Windows 11: {0}.{1}. Поддерживаемые сборки: 22621.963 и выше. Запустите обновление Windows и попробуйте заново UnsupportedLanguageMode = Сессия PowerShell работает в ограниченном режиме LoggedInUserNotAdmin = Текущий вошедший пользователь не обладает правами администратора UnsupportedPowerShell = Вы пытаетесь запустить скрипт в PowerShell {0}.{1}. Запустите скрипт в соответствующей версии PowerShell diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/tr-TR/Sophia.psd1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/tr-TR/Sophia.psd1 index 2d02555a..016d290f 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/tr-TR/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/tr-TR/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = Bu betik sadece Windows 11 21H2 sürüm ve üstünü destekliyor -UpdateWarning = Windows 11 yapınız: {0}.{1}. Desteklenen yapılar: 22000.1335, 22621.963 ve üstünü destekliyor. Windows Update'i çalıştırın ve tekrar deneyin +UpdateWarning = Windows 11 yapınız: {0}.{1}. Desteklenen yapılar: 22621.963 ve üstünü destekliyor. Windows Update'i çalıştırın ve tekrar deneyin UnsupportedLanguageMode = Sınırlı bir dil modunda çalışan PowerShell oturumu LoggedInUserNotAdmin = Oturum açan kullanıcının yönetici hakları yok UnsupportedPowerShell = Komut dosyasını PowerShell {0}.{1} aracılığıyla çalıştırmaya çalışıyorsunuz. Komut dosyasını uygun PowerShell sürümünde çalıştırın diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/uk-UA/Sophia.psd1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/uk-UA/Sophia.psd1 index bac02929..76699320 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/uk-UA/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/uk-UA/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = Скрипт підтримує тільки Windows 11 21H2 та вище -UpdateWarning = Ваш білд Windows 11: {0}.{1}. Підтримувані збірки: 22000.1335, 22621.963 та вище. Запустіть Windows Update і повторіть спробу +UpdateWarning = Ваш білд Windows 11: {0}.{1}. Підтримувані збірки: 22621.963 та вище. Запустіть Windows Update і повторіть спробу UnsupportedLanguageMode = Сесія PowerShell працює в обмеженому режимі LoggedInUserNotAdmin = Поточний користувач, що увійшов, не має прав адміністратора UnsupportedPowerShell = Ви намагаєтеся запустити скрипт в PowerShell {0}.{1}. Запустіть скрипт у відповідній версії PowerShell diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/zh-CN/Sophia.psd1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/zh-CN/Sophia.psd1 index bbb1c210..4ef87048 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/zh-CN/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/zh-CN/Sophia.psd1 @@ -1,6 +1,6 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBuild = 该脚本支持Windows 11版本21H2和更高版本 -UpdateWarning = 您的Windows 11构建: {0}.{1}。支持的构建: 22000.1335, 22621.963和更高版本。运行Windows Update并再次尝试 +UpdateWarning = 您的Windows 11构建: {0}.{1}。支持的构建: 22621.963和更高版本。运行Windows Update并再次尝试 UnsupportedLanguageMode = PowerShell会话在有限的语言模式下运行 LoggedInUserNotAdmin = 登录的用户没有管理员的权利 UnsupportedPowerShell = 你想通过PowerShell {0}.{1}运行脚本。在适当的PowerShell版本中运行该脚本 diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 index e26b3836..02d57e4f 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 @@ -13,7 +13,7 @@ .NOTES Supported Windows 11 versions Versions: 21H2/22H2/23H2+ - Builds: 22000.1335+, 22621.963+ + Builds: 22621.963+ Editions: Home/Pro/Enterprise .LINK GitHub @@ -60,38 +60,64 @@ function Checks { {$_ -eq 22000} { - if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -lt 1335) - { - # Check whether the OS minor build version is 1335 minimum - # https://docs.microsoft.com/en-us/windows/release-health/windows11-release-information - $CurrentBuild = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name CurrentBuild - $UBR = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR + # Download PC Health Check app + $DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" + $Parameters = @{ + Uri = "https://aka.ms/GetPCHealthCheckApp" + OutFile = "$DownloadsFolder\WindowsPCHealthCheckSetup.msi" + UseBasicParsing = $true + Verbose = $true + } + Invoke-WebRequest @Parameters - Write-Warning -Message ($Localization.UpdateWarning -f $CurrentBuild.CurrentBuild, $UBR.UBR) + # Extract WindowsPCHealthCheckSetup.msi without installing + $Arguments = @( + "/a `"$DownloadsFolder\WindowsPCHealthCheckSetup.msi`"", + "TARGETDIR=`"$DownloadsFolder\WindowsPCHealthCheckSetup`"", + "/qb" + ) + Start-Process -FilePath "msiexec" -ArgumentList $Arguments -Wait + Remove-Item -Path "$DownloadsFolder\WindowsPCHealthCheckSetup.msi" -Force + Start-Process -FilePath "$DownloadsFolder\WindowsPCHealthCheckSetup\PCHealthCheck\PCHealthCheck.exe" - Start-Process -FilePath "https://t.me/sophia_chat" + # Download Windows 11 Installation Assistant + # https://www.microsoft.com/software-download/windows11 + $DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" + $Parameters = @{ + Uri = "https://go.microsoft.com/fwlink/?linkid=2171764" + OutFile = "$DownloadsFolder\Windows11InstallationAssistant.exe" + UseBasicParsing = $true + Verbose = $true + } + Invoke-WebRequest @Parameters + Start-Process -FilePath "$DownloadsFolder\Windows11InstallationAssistant.exe" -ArgumentList "/SkipEULA" - # Enable receiving updates for other Microsoft products when you update Windows - (New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "") + $CurrentBuild = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name CurrentBuild + $UBR = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR + Write-Warning -Message ($Localization.UpdateWarning -f $CurrentBuild.CurrentBuild, $UBR.UBR) - Start-Sleep -Seconds 1 + Start-Process -FilePath "https://t.me/sophia_chat" - # Check for UWP apps updates - Get-CimInstance -Namespace root/CIMV2/mdm/dmmap -ClassName MDM_EnterpriseModernAppManagement_AppManagement01 | Invoke-CimMethod -MethodName UpdateScanMethod + # Enable receiving updates for other Microsoft products when you update Windows + (New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "") - # Open the "Windows Update" page - Start-Process -FilePath "ms-settings:windowsupdate" + Start-Sleep -Seconds 1 - # Check for updates - Start-Process -FilePath "ms-settings:windowsupdate-action" + # Check for UWP apps updates + Get-CimInstance -Namespace root/CIMV2/mdm/dmmap -ClassName MDM_EnterpriseModernAppManagement_AppManagement01 | Invoke-CimMethod -MethodName UpdateScanMethod - Start-Sleep -Seconds 1 + # Open the "Windows Update" page + Start-Process -FilePath "ms-settings:windowsupdate" - # Trigger Windows Update for detecting new updates - (New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow() + # Check for updates + Start-Process -FilePath "ms-settings:windowsupdate-action" - exit - } + Start-Sleep -Seconds 1 + + # Trigger Windows Update for detecting new updates + (New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow() + + exit } {$_ -ge 22621} { @@ -101,7 +127,6 @@ function Checks # https://docs.microsoft.com/en-us/windows/release-health/windows11-release-information $CurrentBuild = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name CurrentBuild $UBR = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR - Write-Warning -Message ($Localization.UpdateWarning -f $CurrentBuild.CurrentBuild, $UBR.UBR) Start-Process -FilePath "https://t.me/sophia_chat"