diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/de-DE/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/de-DE/Sophia.psd1 index a7594ec1..d99a91ca 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/de-DE/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/de-DE/Sophia.psd1 @@ -1,6 +1,7 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Das Skript unterstützt nur Windows 10 x64 UnsupportedOSBuild = Das Skript unterstützt Windows 10 Enterprise LTSC 2019 +UpdateWarning = Das kumulative Windows 10-Update wurde installiert: {0}. Unterstütztes kumulatives Update: 3046 und höher 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 @@ -11,6 +12,7 @@ bin = Im Ordner "bin" befinden sich keine RebootPending = Der PC wartet darauf, neu gestartet zu werden UnsupportedRelease = Neue Version gefunden CustomizationWarning = \nHaben Sie alle Funktionen in der voreingestellten Datei {0} angepasst, bevor Sie Sophia Script ausführen? +DefenderBroken = \nMicrosoft Defender defekt oder aus dem Betriebssystem entfernt ControlledFolderAccessDisabled = Kontrollierter Ordnerzugriff deaktiviert ScheduledTasks = Geplante Aufgaben WindowsFeaturesTitle = Windows-Features diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/en-US/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/en-US/Sophia.psd1 index 66e94024..60f45ccf 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/en-US/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/en-US/Sophia.psd1 @@ -1,6 +1,7 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = The script supports Windows 10 x64 only UnsupportedOSBuild = The script supports Windows 10 Enterprise LTSC 2019 +UpdateWarning = Windows 10 cumulative update installed: {0}. Supported cumulative update: 3046 and higher 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 @@ -11,6 +12,7 @@ bin = There are no files in the bin folder RebootPending = The PC is waiting to be restarted UnsupportedRelease = A new version found CustomizationWarning = \nHave you customized every function in the {0} preset file before running Sophia Script? +DefenderBroken = \nMicrosoft Defender broken or removed from the OS ControlledFolderAccessDisabled = Controlled folder access disabled ScheduledTasks = Scheduled tasks WindowsFeaturesTitle = Windows features diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/es-ES/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/es-ES/Sophia.psd1 index 19a37aa5..ab2753b1 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/es-ES/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/es-ES/Sophia.psd1 @@ -1,6 +1,7 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = El script sólo es compatible con Windows 10 x64 UnsupportedOSBuild = El script es compatible con versión Windows 10 Enterprise LTSC 2019 +UpdateWarning = Actualización acumulativa de Windows 10 instalada: {0}. Actualización acumulativa soportada: 3046 y superior 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 @@ -11,6 +12,7 @@ bin = No hay archivos en la carpeta bin. P RebootPending = El PC está esperando a ser reiniciado UnsupportedRelease = Una nueva versión encontrada CustomizationWarning = \n¿Ha personalizado todas las funciones del archivo predeterminado {0} antes de ejecutar Sophia Script? +DefenderBroken = \nMicrosoft Defender defekt oder aus dem Betriebssystem entfernt ControlledFolderAccessDisabled = Acceso a la carpeta controlada deshabilitado ScheduledTasks = Tareas programadas WindowsFeaturesTitle = Características de Windows diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/fr-FR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/fr-FR/Sophia.psd1 index 28d90225..ba9fca9f 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/fr-FR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/fr-FR/Sophia.psd1 @@ -1,6 +1,7 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Le script supporte uniquement Windows 10 x64 UnsupportedOSBuild = Le script supporte le version Windows 10 Enterprise LTSC 2019 +UpdateWarning = La mise à jour cumulative de Windows 10 est installée : {0}. Mise à jour cumulative prise en charge : 3046 et plus 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 @@ -11,6 +12,7 @@ bin = Il n'y a pas de fichiers dans le dos RebootPending = Le PC attend d'être redémarré UnsupportedRelease = Nouvelle version trouvée CustomizationWarning = \nAvez-vous personnalisé chaque fonction du fichier de préréglage {0} avant d'exécuter Sophia Script? +DefenderBroken = \nMicrosoft Defender cassé ou supprimé du système d'exploitation ControlledFolderAccessDisabled = Contrôle d'accès aux dossiers désactivé ScheduledTasks = Tâches planifiées WindowsFeaturesTitle = Fonctionnalités diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/hu-HU/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/hu-HU/Sophia.psd1 index 0d05d8f2..03f171dc 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/hu-HU/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/hu-HU/Sophia.psd1 @@ -1,6 +1,7 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = A szkript csak a Windows 10 64 bites verziót támogatja UnsupportedOSBuild = A szkript támogatja a Windows 10 Enterprise LTSC 2019 kiadást +UpdateWarning = A Windows 10 összesített frissítése telepítve: {0}. Támogatott kumulatív frissítés: 3046 és magasabb verziószámok 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 @@ -11,6 +12,7 @@ bin = A bin mappában nincsenek fájlok. K RebootPending = A számítógép újraindításra vár UnsupportedRelease = Új verzió érhető el CustomizationWarning = \nSzemélyre szabott minden opciót a {0} preset fájlban, mielőtt futtatni kívánja a Sophia szkriptet? +DefenderBroken = \nA Microsoft Defender elromlott vagy eltávolították az operációs rendszerből ControlledFolderAccessDisabled = Vezérelt mappához való hozzáférés kikapcsolva ScheduledTasks = Ütemezett feladatok WindowsFeaturesTitle = Windows szolgáltatások diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/it-IT/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/it-IT/Sophia.psd1 index 0f7ca3bb..bc43c98b 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/it-IT/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/it-IT/Sophia.psd1 @@ -1,6 +1,7 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Lo script supporta solo Windows 10 x64 UnsupportedOSBuild = Lo script supporta Windows 10 Enterprise LTSC 2019 +UpdateWarning = Windows 10 cumulative update installato: {0}. È necessario l'aggiornamento cumulativo 3046 o superiori 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 @@ -11,6 +12,7 @@ bin = Non ci sono file nella cartella bin. RebootPending = Il PC è in attesa di essere riavviato UnsupportedRelease = Nuova versione trovata CustomizationWarning = \nSono state personalizzate tutte le funzioni nel file di configurazione {0} prima di eseguire Sophia Script? +DefenderBroken = \nMicrosoft Defender rimosso dal sistema ControlledFolderAccessDisabled = l'accesso alle cartelle controllata disattivata ScheduledTasks = Attività pianificate WindowsFeaturesTitle = Funzionalità di Windows diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/pt-BR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/pt-BR/Sophia.psd1 index 5de25125..228ad692 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/pt-BR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/pt-BR/Sophia.psd1 @@ -1,6 +1,7 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = O script suporta somente Windows 10 x64 UnsupportedOSBuild = O script suporta versões Windows 10 Enterprise LTSC 2019 +UpdateWarning = Atualização cumulativa do Windows 10 instalado: {0}. Actualização acumulada suportada: 3046 e superior 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 @@ -11,6 +12,7 @@ bin = Não existem ficheiros na pasta bin. RebootPending = O PC está esperando para ser reiniciado UnsupportedRelease = Nova versão encontrada CustomizationWarning = \nVocê personalizou todas as funções no arquivo de predefinição {0} antes de executar o Sophia Script? +DefenderBroken = \nMicrosoft Defender quebrado ou removido do sistema operativo ControlledFolderAccessDisabled = Acesso controlado a pasta desativada ScheduledTasks = Tarefas agendadas WindowsFeaturesTitle = Recursos do Windows diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/ru-RU/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/ru-RU/Sophia.psd1 index 476a5555..f6420b8d 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/ru-RU/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/ru-RU/Sophia.psd1 @@ -1,6 +1,7 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Скрипт поддерживает только Windows 10 x64 UnsupportedOSBuild = Скрипт поддерживает только Windows 10 Enterprise LTSC 2019 +UpdateWarning = Установленный накопительный пакет обновления Windows 10: {0}. Поддерживаемый накопительный пакет обновления: 3046 и выше UnsupportedLanguageMode = Сессия PowerShell работает в ограниченном режиме LoggedInUserNotAdmin = Текущий вошедший пользователь не обладает правами администратора UnsupportedPowerShell = Вы пытаетесь запустить скрипт в PowerShell {0}.{1}. Запустите скрипт в соответствующей версии PowerShell @@ -11,6 +12,7 @@ bin = В папке bin отсутству RebootPending = Компьютер ожидает перезагрузки UnsupportedRelease = Обнаружена новая версия CustomizationWarning = \nВы настроили все функции в пресет-файле {0} перед запуском Sophia Script? +DefenderBroken = \nMicrosoft Defender сломан или удален из ОС ControlledFolderAccessDisabled = Контролируемый доступ к папкам выключен ScheduledTasks = Запланированные задания WindowsFeaturesTitle = Компоненты Windows diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/tr-TR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/tr-TR/Sophia.psd1 index a356a13a..e183f3ae 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/tr-TR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/tr-TR/Sophia.psd1 @@ -1,6 +1,7 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Bu betik sadece Windows 10 x64 destekliyor UnsupportedOSBuild = Bu betik sadece Windows 10 Enterprise LTSC 2019 +UpdateWarning = Windows 10 toplu güncelleştirmesi yüklendi: {0}. Desteklenen toplu güncelleme: 3046 ve üstü 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 @@ -11,6 +12,7 @@ bin = bin klasöründe dosya yok. Lütfen RebootPending = PC yeniden başlatılmayı bekliyor UnsupportedRelease = Yeni sürüm bulundu CustomizationWarning = \nSophia Script'i çalıştırmadan önce {0} ön ayar dosyasındaki her işlevi özelleştirdiniz mi? +DefenderBroken = \nMicrosoft Defender bozuk veya işletim sisteminden kaldırıldı ControlledFolderAccessDisabled = Kontrollü klasör erişimi devre dışı bırakıldı ScheduledTasks = Zamanlanan görevler WindowsFeaturesTitle = Características do Windows diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/uk-UA/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/uk-UA/Sophia.psd1 index 33a29bb4..cbb395eb 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/uk-UA/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/uk-UA/Sophia.psd1 @@ -1,6 +1,7 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Скрипт підтримує тільки Windows 10 x64 UnsupportedOSBuild = Скрипт підтримує тільки Windows 10 Enterprise LTSC 2019 +UpdateWarning = Встановлений зведене оновлення Windows 10: {0}. Підтримуваний накопичувальний пакет оновлення: 3046 і вище UnsupportedLanguageMode = Сесія PowerShell працює в обмеженому режимі LoggedInUserNotAdmin = Поточний увійшов користувач не володіє правами адміністратора UnsupportedPowerShell = Ви намагаєтеся запустити скрипт в PowerShell {0}.{1}. Запустіть скрипт у відповідній версії PowerShell @@ -11,6 +12,7 @@ bin = У папці bin немає фай RebootPending = Комп'ютер очікує на перезавантаження UnsupportedRelease = Виявлено нову версію CustomizationWarning = \nВи налаштували всі функції в пресет-файлі {0} перед запуском Sophia Script? +DefenderBroken = \nMicrosoft Defender пошкоджено або видалено з ОС ControlledFolderAccessDisabled = Контрольований доступ до папок вимкнений ScheduledTasks = Заплановані задачі WindowsFeaturesTitle = Компоненти Windows diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/zh-CN/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/zh-CN/Sophia.psd1 index afe6393c..0b85ec0e 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/zh-CN/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Localizations/zh-CN/Sophia.psd1 @@ -1,6 +1,7 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = 该脚本仅支持Windows 10 x64 UnsupportedOSBuild = 该脚本支持Windows 10版本Enterprise LTSC 2019 +UpdateWarning = 安装了Windows 10累积更新:{0}. 支持的累积更新:3046及以上 UnsupportedLanguageMode = PowerShell会话在有限的语言模式下运行 LoggedInUserNotAdmin = 登录的用户没有管理员的权利 UnsupportedPowerShell = 你想通过PowerShell {0}.{1}运行脚本。在适当的PowerShell版本中运行该脚本 @@ -11,6 +12,7 @@ bin = bin文件夹中没有文件。请重 RebootPending = 计算机正在等待重新启动 UnsupportedRelease = 找到新版本 CustomizationWarning = \n在运行Sophia Script之前,您是否已自定义{0}预设文件中的每个函数? +DefenderBroken = \n微软卫士被破坏或从操作系统中删除 ControlledFolderAccessDisabled = “受控文件夹访问”已禁用 ScheduledTasks = 计划任务 WindowsFeaturesTitle = Windows功能 diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Module/Sophia.psm1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Module/Sophia.psm1 index ad824ada..23ea1fc6 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Module/Sophia.psm1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2019/Module/Sophia.psm1 @@ -272,38 +272,6 @@ function Checkings # Unblock all files in the script folder by removing the Zone.Identifier alternate data stream with a value of "3" Get-ChildItem -Path $PSScriptRoot\..\ -File -Recurse -Force | Unblock-File - # Display a warning message about whether a user has customized the preset file - if ($Warning) - { - # Get the name of a preset (e.g Sophia.ps1) regardless it was named - $PresetName = Split-Path -Path ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File -match ".ps1"}).File -Leaf - - $Title = "" - $Message = $Localization.CustomizationWarning -f $PresetName - $Yes = $Localization.Yes - $No = $Localization.No - $Options = "&$No", "&$Yes" - $DefaultChoice = 0 - $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) - - switch ($Result) - { - "0" - { - Invoke-Item -Path $PSScriptRoot\..\$PresetName - - Start-Sleep -Seconds 5 - - Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#how-to-use" - exit - } - "1" - { - continue - } - } - } - #region Defender Checkings # Turn off Controlled folder access to let the script proceed # Checking whether Defender wasn't disabled first @@ -319,14 +287,22 @@ function Checkings } # Checking services - Get-Service -Name Windefend, SecurityHealthService, wscsvc -ErrorAction Ignore | ForEach-Object -Process { - if (($null -ne $_.Name) -and ($_.Status -eq "running")) + @("Windefend", "SecurityHealthService", "wscsvc") | ForEach-Object -Process { + if ($null -eq (Get-Service -Name $_ -ErrorAction Ignore)) { - $Script:DefenderServices = $true + $Localization.DefenderBroken + exit } else { - $Script:DefenderServices = $false + if ((Get-Service -Name $_ -ErrorAction Ignore).Status -eq "running") + { + $Script:DefenderServices = $true + } + else + { + $Script:DefenderServices = $false + } } } @@ -350,7 +326,7 @@ function Checkings } # https://docs.microsoft.com/en-us/graph/api/resources/intune-devices-windowsdefenderproductstatus?view=graph-rest-beta - if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AMEngineVersion -eq 0.0.0.0) + if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AMEngineVersion -eq "0.0.0.0") { $Script:DefenderAMEngineVersion = $false } @@ -384,6 +360,38 @@ function Checkings } #endregion Defender Checkings + # Display a warning message about whether a user has customized the preset file + if ($Warning) + { + # Get the name of a preset (e.g Sophia.ps1) regardless it was named + $PresetName = Split-Path -Path ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File -match ".ps1"}).File -Leaf + + $Title = "" + $Message = $Localization.CustomizationWarning -f $PresetName + $Yes = $Localization.Yes + $No = $Localization.No + $Options = "&$No", "&$Yes" + $DefaultChoice = 0 + $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) + + switch ($Result) + { + "0" + { + Invoke-Item -Path $PSScriptRoot\..\$PresetName + + Start-Sleep -Seconds 5 + + Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#how-to-use" + exit + } + "1" + { + continue + } + } + } + # Save all opened folders in order to restore them after File Explorer restart $Script:OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke() } diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/de-DE/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/de-DE/Sophia.psd1 index f55f70bc..47ca9173 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/de-DE/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/de-DE/Sophia.psd1 @@ -12,6 +12,7 @@ bin = Im Ordner "bin" befinden sich keine RebootPending = Der PC wartet darauf, neu gestartet zu werden UnsupportedRelease = Neue Version gefunden CustomizationWarning = \nHaben Sie alle Funktionen in der voreingestellten Datei {0} angepasst, bevor Sie Sophia Script ausführen? +DefenderBroken = \nMicrosoft Defender defekt oder aus dem Betriebssystem entfernt ControlledFolderAccessDisabled = Kontrollierter Ordnerzugriff deaktiviert ScheduledTasks = Geplante Aufgaben WindowsFeaturesTitle = Windows-Features diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/en-US/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/en-US/Sophia.psd1 index 5f696126..7ebef125 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/en-US/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/en-US/Sophia.psd1 @@ -12,6 +12,7 @@ bin = There are no files in the bin folder RebootPending = The PC is waiting to be restarted UnsupportedRelease = A new version found CustomizationWarning = \nHave you customized every function in the {0} preset file before running Sophia Script? +DefenderBroken = \nMicrosoft Defender broken or removed from the OS ControlledFolderAccessDisabled = Controlled folder access disabled ScheduledTasks = Scheduled tasks WindowsFeaturesTitle = Windows features diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/es-ES/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/es-ES/Sophia.psd1 index 8e9e168a..bbb0ad0a 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/es-ES/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/es-ES/Sophia.psd1 @@ -12,6 +12,7 @@ bin = No hay archivos en la carpeta bin. P RebootPending = El PC está esperando a ser reiniciado UnsupportedRelease = Una nueva versión encontrada CustomizationWarning = \n¿Ha personalizado todas las funciones del archivo predeterminado {0} antes de ejecutar Sophia Script? +DefenderBroken = \nMicrosoft Defender defekt oder aus dem Betriebssystem entfernt ControlledFolderAccessDisabled = Acceso a la carpeta controlada deshabilitado ScheduledTasks = Tareas programadas WindowsFeaturesTitle = Características de Windows diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/fr-FR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/fr-FR/Sophia.psd1 index 30fa8734..ae6cc719 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/fr-FR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/fr-FR/Sophia.psd1 @@ -1,7 +1,7 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Le script supporte uniquement Windows 10 x64 UnsupportedOSBuild = Le script supporte les versions Windows 10 Enterprise LTSC 2021 -UpdateWarning = La mise à jour cumulative de Windows 10 est installée : {0}. Mise à jour cumulative prise en charge: 1766 et plus +UpdateWarning = La mise à jour cumulative de Windows 10 est installée: {0}. Mise à jour cumulative prise en charge: 1766 et plus 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 @@ -12,6 +12,7 @@ bin = Il n'y a pas de fichiers dans le dos RebootPending = Le PC attend d'être redémarré UnsupportedRelease = Nouvelle version trouvée CustomizationWarning = \nAvez-vous personnalisé chaque fonction du fichier de préréglage {0} avant d'exécuter Sophia Script? +DefenderBroken = \nMicrosoft Defender cassé ou supprimé du système d'exploitation ControlledFolderAccessDisabled = Contrôle d'accès aux dossiers désactivé ScheduledTasks = Tâches planifiées WindowsFeaturesTitle = Fonctionnalités diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/hu-HU/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/hu-HU/Sophia.psd1 index 1f638ea2..49815d46 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/hu-HU/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/hu-HU/Sophia.psd1 @@ -12,6 +12,7 @@ bin = A bin mappában nincsenek fájlok. K RebootPending = A számítógép újraindításra vár UnsupportedRelease = Új verzió érhető el CustomizationWarning = \nSzemélyre szabott minden opciót a {0} preset fájlban, mielőtt futtatni kívánja a Sophia szkriptet? +DefenderBroken = \nA Microsoft Defender elromlott vagy eltávolították az operációs rendszerből ControlledFolderAccessDisabled = Vezérelt mappához való hozzáférés kikapcsolva ScheduledTasks = Ütemezett feladatok WindowsFeaturesTitle = Windows szolgáltatások diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/it-IT/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/it-IT/Sophia.psd1 index 5bf39d72..bf2a565b 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/it-IT/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/it-IT/Sophia.psd1 @@ -12,6 +12,7 @@ bin = Non ci sono file nella cartella bin. RebootPending = Il PC è in attesa di essere riavviato UnsupportedRelease = Nuova versione trovata CustomizationWarning = \nSono state personalizzate tutte le funzioni nel file di configurazione {0} prima di eseguire Sophia Script? +DefenderBroken = \nMicrosoft Defender rimosso dal sistema ControlledFolderAccessDisabled = l'accesso alle cartelle controllata disattivata ScheduledTasks = Attività pianificate WindowsFeaturesTitle = Funzionalità di Windows diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/pt-BR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/pt-BR/Sophia.psd1 index ddcadb19..c8a38879 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/pt-BR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/pt-BR/Sophia.psd1 @@ -12,6 +12,7 @@ bin = Não existem ficheiros na pasta bin. RebootPending = O PC está esperando para ser reiniciado UnsupportedRelease = Nova versão encontrada CustomizationWarning = \nVocê personalizou todas as funções no arquivo de predefinição {0} antes de executar o Sophia Script? +DefenderBroken = \nMicrosoft Defender quebrado ou removido do sistema operativo ControlledFolderAccessDisabled = Acesso controlado a pasta desativada ScheduledTasks = Tarefas agendadas WindowsFeaturesTitle = Recursos do Windows diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/ru-RU/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/ru-RU/Sophia.psd1 index 638143b3..ff873b90 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/ru-RU/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/ru-RU/Sophia.psd1 @@ -12,6 +12,7 @@ bin = В папке bin отсутству RebootPending = Компьютер ожидает перезагрузки UnsupportedRelease = Обнаружена новая версия CustomizationWarning = \nВы настроили все функции в пресет-файле {0} перед запуском Sophia Script? +DefenderBroken = \nMicrosoft Defender сломан или удален из ОС ControlledFolderAccessDisabled = Контролируемый доступ к папкам выключен ScheduledTasks = Запланированные задания WindowsFeaturesTitle = Компоненты Windows diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/tr-TR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/tr-TR/Sophia.psd1 index 94377dd1..67fd7368 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/tr-TR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/tr-TR/Sophia.psd1 @@ -12,6 +12,7 @@ bin = bin klasöründe dosya yok. Lütfen RebootPending = PC yeniden başlatılmayı bekliyor UnsupportedRelease = Yeni sürüm bulundu CustomizationWarning = \nSophia Script'i çalıştırmadan önce {0} ön ayar dosyasındaki her işlevi özelleştirdiniz mi? +DefenderBroken = \nMicrosoft Defender bozuk veya işletim sisteminden kaldırıldı ControlledFolderAccessDisabled = Kontrollü klasör erişimi devre dışı bırakıldı ScheduledTasks = Zamanlanan görevler WindowsFeaturesTitle = Características do Windows diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/uk-UA/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/uk-UA/Sophia.psd1 index 05c3b675..aa4bd10b 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/uk-UA/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/uk-UA/Sophia.psd1 @@ -12,6 +12,7 @@ bin = У папці bin немає фай RebootPending = Комп'ютер очікує на перезавантаження UnsupportedRelease = Виявлено нову версію CustomizationWarning = \nВи налаштували всі функції в пресет-файлі {0} перед запуском Sophia Script? +DefenderBroken = \nMicrosoft Defender пошкоджено або видалено з ОС ControlledFolderAccessDisabled = Контрольований доступ до папок вимкнений ScheduledTasks = Заплановані задачі WindowsFeaturesTitle = Компоненти Windows diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/zh-CN/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/zh-CN/Sophia.psd1 index d3e50c6b..90683a39 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/zh-CN/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Localizations/zh-CN/Sophia.psd1 @@ -12,6 +12,7 @@ bin = bin文件夹中没有文件。请重 RebootPending = 计算机正在等待重新启动 UnsupportedRelease = 找到新版本 CustomizationWarning = \n在运行Sophia Script之前,您是否已自定义{0}预设文件中的每个函数? +DefenderBroken = \n微软卫士被破坏或从操作系统中删除 ControlledFolderAccessDisabled = “受控文件夹访问”已禁用 ScheduledTasks = 计划任务 WindowsFeaturesTitle = Windows功能 diff --git a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Module/Sophia.psm1 b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Module/Sophia.psm1 index 6e5c5707..ae885341 100644 --- a/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Module/Sophia.psm1 +++ b/Sophia Script/Sophia Script for Windows 10 LTSC 2021/Module/Sophia.psm1 @@ -272,38 +272,6 @@ function Checkings # Unblock all files in the script folder by removing the Zone.Identifier alternate data stream with a value of "3" Get-ChildItem -Path $PSScriptRoot\..\ -File -Recurse -Force | Unblock-File - # Display a warning message about whether a user has customized the preset file - if ($Warning) - { - # Get the name of a preset (e.g Sophia.ps1) regardless it was named - $PresetName = Split-Path -Path ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File -match ".ps1"}).File -Leaf - - $Title = "" - $Message = $Localization.CustomizationWarning -f $PresetName - $Yes = $Localization.Yes - $No = $Localization.No - $Options = "&$No", "&$Yes" - $DefaultChoice = 0 - $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) - - switch ($Result) - { - "0" - { - Invoke-Item -Path $PSScriptRoot\..\$PresetName - - Start-Sleep -Seconds 5 - - Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#how-to-use" - exit - } - "1" - { - continue - } - } - } - #region Defender Checkings # Turn off Controlled folder access to let the script proceed # Checking whether Defender wasn't disabled first @@ -319,14 +287,22 @@ function Checkings } # Checking services - Get-Service -Name Windefend, SecurityHealthService, wscsvc -ErrorAction Ignore | ForEach-Object -Process { - if (($null -ne $_.Name) -and ($_.Status -eq "running")) + @("Windefend", "SecurityHealthService", "wscsvc") | ForEach-Object -Process { + if ($null -eq (Get-Service -Name $_ -ErrorAction Ignore)) { - $Script:DefenderServices = $true + $Localization.DefenderBroken + exit } else { - $Script:DefenderServices = $false + if ((Get-Service -Name $_ -ErrorAction Ignore).Status -eq "running") + { + $Script:DefenderServices = $true + } + else + { + $Script:DefenderServices = $false + } } } @@ -350,7 +326,7 @@ function Checkings } # https://docs.microsoft.com/en-us/graph/api/resources/intune-devices-windowsdefenderproductstatus?view=graph-rest-beta - if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AMEngineVersion -eq 0.0.0.0) + if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AMEngineVersion -eq "0.0.0.0") { $Script:DefenderAMEngineVersion = $false } @@ -384,6 +360,38 @@ function Checkings } #endregion Defender Checkings + # Display a warning message about whether a user has customized the preset file + if ($Warning) + { + # Get the name of a preset (e.g Sophia.ps1) regardless it was named + $PresetName = Split-Path -Path ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File -match ".ps1"}).File -Leaf + + $Title = "" + $Message = $Localization.CustomizationWarning -f $PresetName + $Yes = $Localization.Yes + $No = $Localization.No + $Options = "&$No", "&$Yes" + $DefaultChoice = 0 + $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) + + switch ($Result) + { + "0" + { + Invoke-Item -Path $PSScriptRoot\..\$PresetName + + Start-Sleep -Seconds 5 + + Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#how-to-use" + exit + } + "1" + { + continue + } + } + } + # Save all opened folders in order to restore them after File Explorer restart $Script:OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke() } diff --git a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/de-DE/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/de-DE/Sophia.psd1 index aad8c697..ca84b540 100644 --- a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/de-DE/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/de-DE/Sophia.psd1 @@ -12,6 +12,7 @@ bin = Im Ordner "bin" befinden sich keine RebootPending = Der PC wartet darauf, neu gestartet zu werden UnsupportedRelease = Neue Version gefunden CustomizationWarning = \nHaben Sie alle Funktionen in der voreingestellten Datei {0} angepasst, bevor Sie Sophia Script ausführen? +DefenderBroken = \nMicrosoft Defender defekt oder aus dem Betriebssystem entfernt ControlledFolderAccessDisabled = Kontrollierter Ordnerzugriff deaktiviert ScheduledTasks = Geplante Aufgaben OneDriveUninstalling = OneDrive deinstallieren… diff --git a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/en-US/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/en-US/Sophia.psd1 index 809471c3..54bef247 100644 --- a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/en-US/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/en-US/Sophia.psd1 @@ -12,6 +12,7 @@ bin = There are no files in the bin folder RebootPending = The PC is waiting to be restarted UnsupportedRelease = A new version found CustomizationWarning = \nHave you customized every function in the {0} preset file before running Sophia Script? +DefenderBroken = \nMicrosoft Defender broken or removed from the OS ControlledFolderAccessDisabled = Controlled folder access disabled ScheduledTasks = Scheduled tasks OneDriveUninstalling = Uninstalling OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/es-ES/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/es-ES/Sophia.psd1 index cd4a6876..0f7a36bf 100644 --- a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/es-ES/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/es-ES/Sophia.psd1 @@ -12,6 +12,7 @@ bin = No hay archivos en la carpeta bin. P RebootPending = El PC está esperando a ser reiniciado UnsupportedRelease = Una nueva versión encontrada CustomizationWarning = \n¿Ha personalizado todas las funciones del archivo predeterminado {0} antes de ejecutar Sophia Script? +DefenderBroken = \nMicrosoft Defender defekt oder aus dem Betriebssystem entfernt ControlledFolderAccessDisabled = Acceso a la carpeta controlada deshabilitado ScheduledTasks = Tareas programadas OneDriveUninstalling = Desinstalar OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/fr-FR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/fr-FR/Sophia.psd1 index 6e0864f8..3347fd33 100644 --- a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/fr-FR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/fr-FR/Sophia.psd1 @@ -1,7 +1,7 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Le script supporte uniquement Windows 10 x64 UnsupportedOSBuild = Le script supporte les versions Windows 10 2004/20H2/21H1/21H2 -UpdateWarning = La mise à jour cumulative de Windows 10 est installée : {0}. Mise à jour cumulative prise en charge : 1766 et plus +UpdateWarning = La mise à jour cumulative de Windows 10 est installée: {0}. Mise à jour cumulative prise en charge: 1766 et plus 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 @@ -12,6 +12,7 @@ bin = Il n'y a pas de fichiers dans le dos RebootPending = Le PC attend d'être redémarré UnsupportedRelease = Nouvelle version trouvée CustomizationWarning = \nAvez-vous personnalisé chaque fonction du fichier de préréglage {0} avant d'exécuter Sophia Script? +DefenderBroken = \nMicrosoft Defender cassé ou supprimé du système d'exploitation ControlledFolderAccessDisabled = Contrôle d'accès aux dossiers désactivé ScheduledTasks = Tâches planifiées OneDriveUninstalling = Désinstalltion de OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/hu-HU/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/hu-HU/Sophia.psd1 index 6092a13d..ef536672 100644 --- a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/hu-HU/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/hu-HU/Sophia.psd1 @@ -12,6 +12,7 @@ bin = A bin mappában nincsenek fájlok. K RebootPending = A számítógép újraindításra vár UnsupportedRelease = Új verzió érhető el CustomizationWarning = \nSzemélyre szabott minden opciót a {0} preset fájlban, mielőtt futtatni kívánja a Sophia szkriptet? +DefenderBroken = \nA Microsoft Defender elromlott vagy eltávolították az operációs rendszerből ControlledFolderAccessDisabled = Vezérelt mappához való hozzáférés kikapcsolva ScheduledTasks = Ütemezett feladatok OneDriveUninstalling = OneDrive eltávolítása... diff --git a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/it-IT/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/it-IT/Sophia.psd1 index 09c83957..49d005db 100644 --- a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/it-IT/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/it-IT/Sophia.psd1 @@ -12,6 +12,7 @@ bin = Non ci sono file nella cartella bin. RebootPending = Il PC è in attesa di essere riavviato UnsupportedRelease = Nuova versione trovata CustomizationWarning = \nSono state personalizzate tutte le funzioni nel file di configurazione {0} prima di eseguire Sophia Script? +DefenderBroken = \nMicrosoft Defender rimosso dal sistema ControlledFolderAccessDisabled = l'accesso alle cartelle controllata disattivata ScheduledTasks = Attività pianificate OneDriveUninstalling = Disinstallazione di OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/pt-BR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/pt-BR/Sophia.psd1 index 7b80ee46..8b044383 100644 --- a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/pt-BR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/pt-BR/Sophia.psd1 @@ -12,6 +12,7 @@ bin = Não existem ficheiros na pasta bin. RebootPending = O PC está esperando para ser reiniciado UnsupportedRelease = Nova versão encontrada CustomizationWarning = \nVocê personalizou todas as funções no arquivo de predefinição {0} antes de executar o Sophia Script? +DefenderBroken = \nMicrosoft Defender quebrado ou removido do sistema operativo ControlledFolderAccessDisabled = Acesso controlado a pasta desativada ScheduledTasks = Tarefas agendadas OneDriveUninstalling = Desinstalar OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/ru-RU/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/ru-RU/Sophia.psd1 index 015444a0..3f467ee2 100644 --- a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/ru-RU/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/ru-RU/Sophia.psd1 @@ -12,6 +12,7 @@ bin = В папке bin отсутству RebootPending = Компьютер ожидает перезагрузки UnsupportedRelease = Обнаружена новая версия CustomizationWarning = \nВы настроили все функции в пресет-файле {0} перед запуском Sophia Script? +DefenderBroken = \nMicrosoft Defender сломан или удален из ОС ControlledFolderAccessDisabled = Контролируемый доступ к папкам выключен ScheduledTasks = Запланированные задания OneDriveUninstalling = Удаление OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/tr-TR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/tr-TR/Sophia.psd1 index 0a6195b7..da3471e7 100644 --- a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/tr-TR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/tr-TR/Sophia.psd1 @@ -12,6 +12,7 @@ bin = bin klasöründe dosya yok. Lütfen RebootPending = PC yeniden başlatılmayı bekliyor UnsupportedRelease = Yeni sürüm bulundu CustomizationWarning = \nSophia Script'i çalıştırmadan önce {0} ön ayar dosyasındaki her işlevi özelleştirdiniz mi? +DefenderBroken = \nMicrosoft Defender bozuk veya işletim sisteminden kaldırıldı ControlledFolderAccessDisabled = Kontrollü klasör erişimi devre dışı bırakıldı ScheduledTasks = Zamanlanan görevler OneDriveUninstalling = OneDrive kaldırılıyor... diff --git a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/uk-UA/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/uk-UA/Sophia.psd1 index 6fe7c968..9c044961 100644 --- a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/uk-UA/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/uk-UA/Sophia.psd1 @@ -12,6 +12,7 @@ bin = У папці bin немає фай RebootPending = Комп'ютер очікує на перезавантаження UnsupportedRelease = Виявлено нову версію CustomizationWarning = \nВи налаштували всі функції в пресет-файлі {0} перед запуском Sophia Script? +DefenderBroken = \nMicrosoft Defender пошкоджено або видалено з ОС ControlledFolderAccessDisabled = Контрольований доступ до папок вимкнений ScheduledTasks = Заплановані задачі OneDriveUninstalling = Видалення OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/zh-CN/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/zh-CN/Sophia.psd1 index af3e3cb5..39043aea 100644 --- a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/zh-CN/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/zh-CN/Sophia.psd1 @@ -12,6 +12,7 @@ bin = bin文件夹中没有文件。请重 RebootPending = 计算机正在等待重新启动 UnsupportedRelease = 找到新版本 CustomizationWarning = \n在运行Sophia Script之前,您是否已自定义{0}预设文件中的每个函数? +DefenderBroken = \n微软卫士被破坏或从操作系统中删除 ControlledFolderAccessDisabled = “受控文件夹访问”已禁用 ScheduledTasks = 计划任务 OneDriveUninstalling = 卸载OneDrive…… diff --git a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Module/Sophia.psm1 b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Module/Sophia.psm1 index 4b76b420..d96bc6bd 100644 --- a/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Module/Sophia.psm1 +++ b/Sophia Script/Sophia Script for Windows 10 PowerShell 7/Module/Sophia.psm1 @@ -280,41 +280,6 @@ function Checkings # Unblock all files in the script folder by removing the Zone.Identifier alternate data stream with a value of "3" Get-ChildItem -Path $PSScriptRoot\..\ -File -Recurse -Force | Unblock-File - # Display a warning message about whether a user has customized the preset file - if ($Warning) - { - # Get the name of a preset (e.g Sophia.ps1) regardless it was named - $PresetName = Split-Path -Path ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File -match ".ps1"}).File -Leaf - - $Title = "" - $Message = $Localization.CustomizationWarning -f $PresetName - $Yes = $Localization.Yes - $No = $Localization.No - $Options = "&$No", "&$Yes" - $DefaultChoice = 0 - $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) - - switch ($Result) - { - "0" - { - Invoke-Item -Path $PSScriptRoot\..\$PresetName - - Start-Sleep -Seconds 5 - - Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#how-to-use" - exit - } - "1" - { - continue - } - } - } - - # Import PowerShell 5.1 modules - Import-Module -Name Microsoft.PowerShell.Management, PackageManagement, Appx -UseWindowsPowerShell - #region Defender Checkings # Turn off Controlled folder access to let the script proceed # Checking whether Defender wasn't disabled first @@ -330,14 +295,22 @@ function Checkings } # Checking services - Get-Service -Name Windefend, SecurityHealthService, wscsvc -ErrorAction Ignore | ForEach-Object -Process { - if (($null -ne $_.Name) -and ($_.Status -eq "running")) + @("Windefend", "SecurityHealthService", "wscsvc") | ForEach-Object -Process { + if ($null -eq (Get-Service -Name $_ -ErrorAction Ignore)) { - $Script:DefenderServices = $true + $Localization.DefenderBroken + exit } else { - $Script:DefenderServices = $false + if ((Get-Service -Name $_ -ErrorAction Ignore).Status -eq "running") + { + $Script:DefenderServices = $true + } + else + { + $Script:DefenderServices = $false + } } } @@ -361,7 +334,7 @@ function Checkings } # https://docs.microsoft.com/en-us/graph/api/resources/intune-devices-windowsdefenderproductstatus?view=graph-rest-beta - if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AMEngineVersion -eq 0.0.0.0) + if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AMEngineVersion -eq "0.0.0.0") { $Script:DefenderAMEngineVersion = $false } @@ -395,6 +368,41 @@ function Checkings } #endregion Defender Checkings + # Display a warning message about whether a user has customized the preset file + if ($Warning) + { + # Get the name of a preset (e.g Sophia.ps1) regardless it was named + $PresetName = Split-Path -Path ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File -match ".ps1"}).File -Leaf + + $Title = "" + $Message = $Localization.CustomizationWarning -f $PresetName + $Yes = $Localization.Yes + $No = $Localization.No + $Options = "&$No", "&$Yes" + $DefaultChoice = 0 + $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) + + switch ($Result) + { + "0" + { + Invoke-Item -Path $PSScriptRoot\..\$PresetName + + Start-Sleep -Seconds 5 + + Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#how-to-use" + exit + } + "1" + { + continue + } + } + } + + # Import PowerShell 5.1 modules + Import-Module -Name Microsoft.PowerShell.Management, PackageManagement, Appx -UseWindowsPowerShell + # Save all opened folders in order to restore them after File Explorer restart $Script:OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke() } diff --git a/Sophia Script/Sophia Script for Windows 10/Localizations/de-DE/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10/Localizations/de-DE/Sophia.psd1 index 1895462a..6ce93238 100644 --- a/Sophia Script/Sophia Script for Windows 10/Localizations/de-DE/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10/Localizations/de-DE/Sophia.psd1 @@ -12,6 +12,7 @@ bin = Im Ordner "bin" befinden sich keine RebootPending = Der PC wartet darauf, neu gestartet zu werden UnsupportedRelease = Neue Version gefunden CustomizationWarning = \nHaben Sie alle Funktionen in der voreingestellten Datei {0} angepasst, bevor Sie Sophia Script ausführen? +DefenderBroken = \nMicrosoft Defender defekt oder aus dem Betriebssystem entfernt ControlledFolderAccessDisabled = Kontrollierter Ordnerzugriff deaktiviert ScheduledTasks = Geplante Aufgaben OneDriveUninstalling = OneDrive deinstallieren… diff --git a/Sophia Script/Sophia Script for Windows 10/Localizations/en-US/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10/Localizations/en-US/Sophia.psd1 index 377b9e6f..03ca0873 100644 --- a/Sophia Script/Sophia Script for Windows 10/Localizations/en-US/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10/Localizations/en-US/Sophia.psd1 @@ -12,6 +12,7 @@ bin = There are no files in the bin folder RebootPending = The PC is waiting to be restarted UnsupportedRelease = A new version found CustomizationWarning = \nHave you customized every function in the {0} preset file before running Sophia Script? +DefenderBroken = \nMicrosoft Defender broken or removed from the OS ControlledFolderAccessDisabled = Controlled folder access disabled ScheduledTasks = Scheduled tasks OneDriveUninstalling = Uninstalling OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 10/Localizations/es-ES/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10/Localizations/es-ES/Sophia.psd1 index 0228a220..7c1b41a5 100644 --- a/Sophia Script/Sophia Script for Windows 10/Localizations/es-ES/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10/Localizations/es-ES/Sophia.psd1 @@ -12,6 +12,7 @@ bin = No hay archivos en la carpeta bin. P RebootPending = El PC está esperando a ser reiniciado UnsupportedRelease = Una nueva versión encontrada CustomizationWarning = \n¿Ha personalizado todas las funciones del archivo predeterminado {0} antes de ejecutar Sophia Script? +DefenderBroken = \nMicrosoft Defender defekt oder aus dem Betriebssystem entfernt ControlledFolderAccessDisabled = Acceso a la carpeta controlada deshabilitado ScheduledTasks = Tareas programadas OneDriveUninstalling = Desinstalar OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 10/Localizations/fr-FR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10/Localizations/fr-FR/Sophia.psd1 index 7c001ec5..79cd6739 100644 --- a/Sophia Script/Sophia Script for Windows 10/Localizations/fr-FR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10/Localizations/fr-FR/Sophia.psd1 @@ -1,7 +1,7 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Le script supporte uniquement Windows 10 x64 UnsupportedOSBuild = Le script supporte les versions Windows 10 2004/20H2/21H1/21H2 -UpdateWarning = La mise à jour cumulative de Windows 10 est installée : {0}. Mise à jour cumulative prise en charge : 1766 et plus +UpdateWarning = La mise à jour cumulative de Windows 10 est installée: {0}. Mise à jour cumulative prise en charge: 1766 et plus 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 @@ -12,6 +12,7 @@ bin = Il n'y a pas de fichiers dans le dos RebootPending = Le PC attend d'être redémarré UnsupportedRelease = Nouvelle version trouvée CustomizationWarning = \nAvez-vous personnalisé chaque fonction du fichier de préréglage {0} avant d'exécuter Sophia Script? +DefenderBroken = \nMicrosoft Defender cassé ou supprimé du système d'exploitation ControlledFolderAccessDisabled = Contrôle d'accès aux dossiers désactivé ScheduledTasks = Tâches planifiées OneDriveUninstalling = Désinstalltion de OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 10/Localizations/hu-HU/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10/Localizations/hu-HU/Sophia.psd1 index 1f06b362..8975d970 100644 --- a/Sophia Script/Sophia Script for Windows 10/Localizations/hu-HU/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10/Localizations/hu-HU/Sophia.psd1 @@ -12,6 +12,7 @@ bin = A bin mappában nincsenek fájlok. K RebootPending = A számítógép újraindításra vár UnsupportedRelease = Új verzió érhető el CustomizationWarning = \nSzemélyre szabott minden opciót a {0} preset fájlban, mielőtt futtatni kívánja a Sophia szkriptet? +DefenderBroken = \nA Microsoft Defender elromlott vagy eltávolították az operációs rendszerből ControlledFolderAccessDisabled = Vezérelt mappához való hozzáférés kikapcsolva ScheduledTasks = Ütemezett feladatok OneDriveUninstalling = OneDrive eltávolítása... diff --git a/Sophia Script/Sophia Script for Windows 10/Localizations/it-IT/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10/Localizations/it-IT/Sophia.psd1 index 35d28199..d3b1bcd3 100644 --- a/Sophia Script/Sophia Script for Windows 10/Localizations/it-IT/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10/Localizations/it-IT/Sophia.psd1 @@ -12,6 +12,7 @@ bin = Non ci sono file nella cartella bin. RebootPending = Il PC è in attesa di essere riavviato UnsupportedRelease = Nuova versione trovata CustomizationWarning = \nSono state personalizzate tutte le funzioni nel file di configurazione {0} prima di eseguire Sophia Script? +DefenderBroken = \nMicrosoft Defender rimosso dal sistema ControlledFolderAccessDisabled = l'accesso alle cartelle controllata disattivata ScheduledTasks = Attività pianificate OneDriveUninstalling = Disinstallazione di OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 10/Localizations/pt-BR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10/Localizations/pt-BR/Sophia.psd1 index 7ff8fdd1..17d6ca25 100644 --- a/Sophia Script/Sophia Script for Windows 10/Localizations/pt-BR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10/Localizations/pt-BR/Sophia.psd1 @@ -12,6 +12,7 @@ bin = Não existem ficheiros na pasta bin. RebootPending = O PC está esperando para ser reiniciado UnsupportedRelease = Nova versão encontrada CustomizationWarning = \nVocê personalizou todas as funções no arquivo de predefinição {0} antes de executar o Sophia Script? +DefenderBroken = \nMicrosoft Defender quebrado ou removido do sistema operativo ControlledFolderAccessDisabled = Acesso controlado a pasta desativada ScheduledTasks = Tarefas agendadas OneDriveUninstalling = Desinstalar OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 10/Localizations/ru-RU/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10/Localizations/ru-RU/Sophia.psd1 index 2e5238ce..1b4359fc 100644 --- a/Sophia Script/Sophia Script for Windows 10/Localizations/ru-RU/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10/Localizations/ru-RU/Sophia.psd1 @@ -12,6 +12,7 @@ bin = В папке bin отсутству RebootPending = Компьютер ожидает перезагрузки UnsupportedRelease = Обнаружена новая версия CustomizationWarning = \nВы настроили все функции в пресет-файле {0} перед запуском Sophia Script? +DefenderBroken = \nMicrosoft Defender сломан или удален из ОС ControlledFolderAccessDisabled = Контролируемый доступ к папкам выключен ScheduledTasks = Запланированные задания OneDriveUninstalling = Удаление OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 10/Localizations/tr-TR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10/Localizations/tr-TR/Sophia.psd1 index 1d2d9c2c..84739f74 100644 --- a/Sophia Script/Sophia Script for Windows 10/Localizations/tr-TR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10/Localizations/tr-TR/Sophia.psd1 @@ -12,6 +12,7 @@ bin = bin klasöründe dosya yok. Lütfen RebootPending = PC yeniden başlatılmayı bekliyor UnsupportedRelease = Yeni sürüm bulundu CustomizationWarning = \nSophia Script'i çalıştırmadan önce {0} ön ayar dosyasındaki her işlevi özelleştirdiniz mi? +DefenderBroken = \nMicrosoft Defender bozuk veya işletim sisteminden kaldırıldı ControlledFolderAccessDisabled = Kontrollü klasör erişimi devre dışı bırakıldı ScheduledTasks = Zamanlanan görevler OneDriveUninstalling = OneDrive kaldırılıyor... diff --git a/Sophia Script/Sophia Script for Windows 10/Localizations/uk-UA/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10/Localizations/uk-UA/Sophia.psd1 index 831f6976..de6300f5 100644 --- a/Sophia Script/Sophia Script for Windows 10/Localizations/uk-UA/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10/Localizations/uk-UA/Sophia.psd1 @@ -12,6 +12,7 @@ bin = У папці bin немає фай RebootPending = Комп'ютер очікує на перезавантаження UnsupportedRelease = Виявлено нову версію CustomizationWarning = \nВи налаштували всі функції в пресет-файлі {0} перед запуском Sophia Script? +DefenderBroken = \nMicrosoft Defender пошкоджено або видалено з ОС ControlledFolderAccessDisabled = Контрольований доступ до папок вимкнений ScheduledTasks = Заплановані задачі OneDriveUninstalling = Видалення OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 10/Localizations/zh-CN/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 10/Localizations/zh-CN/Sophia.psd1 index 0136f653..4065cdb2 100644 --- a/Sophia Script/Sophia Script for Windows 10/Localizations/zh-CN/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 10/Localizations/zh-CN/Sophia.psd1 @@ -12,6 +12,7 @@ bin = bin文件夹中没有文件。请重 RebootPending = 计算机正在等待重新启动 UnsupportedRelease = 找到新版本 CustomizationWarning = \n在运行Sophia Script之前,您是否已自定义{0}预设文件中的每个函数? +DefenderBroken = \n微软卫士被破坏或从操作系统中删除 ControlledFolderAccessDisabled = “受控文件夹访问”已禁用 ScheduledTasks = 计划任务 OneDriveUninstalling = 卸载OneDrive…… diff --git a/Sophia Script/Sophia Script for Windows 10/Module/Sophia.psm1 b/Sophia Script/Sophia Script for Windows 10/Module/Sophia.psm1 index e353c6a9..4ace1d9d 100644 --- a/Sophia Script/Sophia Script for Windows 10/Module/Sophia.psm1 +++ b/Sophia Script/Sophia Script for Windows 10/Module/Sophia.psm1 @@ -278,38 +278,6 @@ function Checkings # Unblock all files in the script folder by removing the Zone.Identifier alternate data stream with a value of "3" Get-ChildItem -Path $PSScriptRoot\..\ -File -Recurse -Force | Unblock-File - # Display a warning message about whether a user has customized the preset file - if ($Warning) - { - # Get the name of a preset (e.g Sophia.ps1) regardless it was named - $PresetName = Split-Path -Path ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File -match ".ps1"}).File -Leaf - - $Title = "" - $Message = $Localization.CustomizationWarning -f $PresetName - $Yes = $Localization.Yes - $No = $Localization.No - $Options = "&$No", "&$Yes" - $DefaultChoice = 0 - $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) - - switch ($Result) - { - "0" - { - Invoke-Item -Path $PSScriptRoot\..\$PresetName - - Start-Sleep -Seconds 5 - - Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#how-to-use" - exit - } - "1" - { - continue - } - } - } - #region Defender Checkings # Turn off Controlled folder access to let the script proceed # Checking whether Defender wasn't disabled first @@ -325,14 +293,22 @@ function Checkings } # Checking services - Get-Service -Name Windefend, SecurityHealthService, wscsvc -ErrorAction Ignore | ForEach-Object -Process { - if (($null -ne $_.Name) -and ($_.Status -eq "running")) + @("Windefend", "SecurityHealthService", "wscsvc") | ForEach-Object -Process { + if ($null -eq (Get-Service -Name $_ -ErrorAction Ignore)) { - $Script:DefenderServices = $true + $Localization.DefenderBroken + exit } else { - $Script:DefenderServices = $false + if ((Get-Service -Name $_ -ErrorAction Ignore).Status -eq "running") + { + $Script:DefenderServices = $true + } + else + { + $Script:DefenderServices = $false + } } } @@ -356,7 +332,7 @@ function Checkings } # https://docs.microsoft.com/en-us/graph/api/resources/intune-devices-windowsdefenderproductstatus?view=graph-rest-beta - if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AMEngineVersion -eq 0.0.0.0) + if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AMEngineVersion -eq "0.0.0.0") { $Script:DefenderAMEngineVersion = $false } @@ -390,6 +366,38 @@ function Checkings } #endregion Defender Checkings + # Display a warning message about whether a user has customized the preset file + if ($Warning) + { + # Get the name of a preset (e.g Sophia.ps1) regardless it was named + $PresetName = Split-Path -Path ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File -match ".ps1"}).File -Leaf + + $Title = "" + $Message = $Localization.CustomizationWarning -f $PresetName + $Yes = $Localization.Yes + $No = $Localization.No + $Options = "&$No", "&$Yes" + $DefaultChoice = 0 + $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) + + switch ($Result) + { + "0" + { + Invoke-Item -Path $PSScriptRoot\..\$PresetName + + Start-Sleep -Seconds 5 + + Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#how-to-use" + exit + } + "1" + { + continue + } + } + } + # Save all opened folders in order to restore them after File Explorer restart $Script:OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke() } diff --git a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/de-DE/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/de-DE/Sophia.psd1 index 84561c20..03d001d0 100644 --- a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/de-DE/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/de-DE/Sophia.psd1 @@ -7,10 +7,11 @@ UnsupportedPowerShell = Sie versuchen ein Skript über Power UnsupportedISE = Das Skript unterstützt nicht die Ausführung über Windows PowerShell ISE Win10TweakerWarning = Wahrscheinlich wurde Ihr Betriebssystem über die Win 10 Tweaker-Hintertür infiziert Windows10DebloaterWarning = Die Stabilität des Windows-Betriebssystems kann durch die Verwendung des Windows10Debloater PowerShell-Skripts von Sycnex beeinträchtigt worden sein. Installieren Sie vorsorglich das gesamte Betriebssystem neu -bin = Im Ordner bin befinden sich keine Dateien. Bitte das Archiv erneut herunterladen +bin = Im Ordner "bin" befinden sich keine Dateien. Bitte das Archiv erneut herunterladen RebootPending = Der PC wartet darauf, neu gestartet zu werden UnsupportedRelease = Neue Version gefunden CustomizationWarning = \nHaben Sie alle Funktionen in der voreingestellten Datei {0} angepasst, bevor Sie Sophia Script ausführen? +DefenderBroken = \nMicrosoft Defender defekt oder aus dem Betriebssystem entfernt ControlledFolderAccessDisabled = Kontrollierter Ordnerzugriff deaktiviert ScheduledTasks = Geplante Aufgaben OneDriveUninstalling = OneDrive deinstallieren… @@ -38,7 +39,7 @@ GraphicsPerformanceTitle = Bevorzugte Grafikleistung GraphicsPerformanceRequest = Möchten Sie die Einstellung der Grafikleistung einer App Ihrer Wahl auf "Hohe Leistung" einstellen? TaskNotificationTitle = Benachrichtigung CleanupTaskNotificationTitle = Wichtige Informationen -CleanupTaskDescription = Bereinigung von nicht verwendeten Windows-Dateien und Updates mit der integrierten Festplattenbereinigung +CleanupTaskDescription = Bereinigung von nicht verwendeten Windows-Dateien und Updates mit der integrierten Festplattenbereinigung CleanupTaskNotificationEventTitle = Aufgabe zum Bereinigen nicht verwendeter Windows-Dateien und -Updates ausführen? CleanupTaskNotificationEvent = Die Bereinigung von Windows wird nicht lange dauern. Das nächste Mal wird diese Benachrichtigung in 30 Tagen erscheinen CleanupTaskNotificationSnoozeInterval = Ein Erinnerungsintervall auswählen diff --git a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/en-US/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/en-US/Sophia.psd1 index 71257e38..377d6f26 100644 --- a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/en-US/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/en-US/Sophia.psd1 @@ -11,6 +11,7 @@ bin = There are no files in the bin folder RebootPending = The PC is waiting to be restarted UnsupportedRelease = A new version found CustomizationWarning = \nHave you customized every function in the {0} preset file before running Sophia Script? +DefenderBroken = \nMicrosoft Defender broken or removed from the OS ControlledFolderAccessDisabled = Controlled folder access disabled ScheduledTasks = Scheduled tasks OneDriveUninstalling = Uninstalling OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/es-ES/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/es-ES/Sophia.psd1 index d5e84a58..b1ede72d 100644 --- a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/es-ES/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/es-ES/Sophia.psd1 @@ -11,6 +11,7 @@ bin = No hay archivos en la carpeta bin. P RebootPending = El PC está esperando a ser reiniciado UnsupportedRelease = Una nueva versión encontrada CustomizationWarning = \n¿Ha personalizado todas las funciones del archivo predeterminado {0} antes de ejecutar Sophia Script? +DefenderBroken = \nMicrosoft Defender defekt oder aus dem Betriebssystem entfernt ControlledFolderAccessDisabled = Acceso a la carpeta controlada deshabilitado ScheduledTasks = Tareas programadas OneDriveUninstalling = Desinstalar OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/fr-FR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/fr-FR/Sophia.psd1 index d3a63890..1fda0c0e 100644 --- a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/fr-FR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/fr-FR/Sophia.psd1 @@ -7,10 +7,11 @@ UnsupportedPowerShell = Vous essayez d'exécuter le script v UnsupportedISE = Le script ne supporte pas l'exécution via Windows PowerShell ISE Win10TweakerWarning = Votre système d'exploitation a probablement été infecté par la porte dérobée Win 10 Tweaker Windows10DebloaterWarning = La stabilité de l'OS Windows peut avoir été compromise par l'utilisation du script PowerShell Windows10Debloater de Sycnex. De manière préventive, réinstallez l'ensemble de l'OS - bin = Il n'y a pas de fichiers dans le dossier bin. Veuillez retélécharger l'archive +bin = Il n'y a pas de fichiers dans le dossier bin. Veuillez retélécharger l'archive RebootPending = Le PC attend d'être redémarré UnsupportedRelease = Nouvelle version trouvée CustomizationWarning = \nAvez-vous personnalisé chaque fonction du fichier de préréglage {0} avant d'exécuter Sophia Script? +DefenderBroken = \nMicrosoft Defender cassé ou supprimé du système d'exploitation ControlledFolderAccessDisabled = Contrôle d'accès aux dossiers désactivé ScheduledTasks = Tâches planifiées OneDriveUninstalling = Désinstalltion de OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/hu-HU/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/hu-HU/Sophia.psd1 index 3ede85b7..8979e9a2 100644 --- a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/hu-HU/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/hu-HU/Sophia.psd1 @@ -11,6 +11,7 @@ bin = A bin mappában nincsenek fájlok. K RebootPending = A számítógép újraindításra vár UnsupportedRelease = Új verzió érhető el CustomizationWarning = \nSzemélyre szabott minden opciót a {0} preset fájlban, mielőtt futtatni kívánja a Sophia szkriptet? +DefenderBroken = \nA Microsoft Defender elromlott vagy eltávolították az operációs rendszerből ControlledFolderAccessDisabled = Vezérelt mappához való hozzáférés kikapcsolva ScheduledTasks = Ütemezett feladatok OneDriveUninstalling = OneDrive eltávolítása... diff --git a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/it-IT/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/it-IT/Sophia.psd1 index 106c4e1f..7c97f96b 100644 --- a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/it-IT/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/it-IT/Sophia.psd1 @@ -11,6 +11,7 @@ bin = Non ci sono file nella cartella bin. RebootPending = Il PC è in attesa di essere riavviato UnsupportedRelease = Nuova versione trovata CustomizationWarning = \nSono state personalizzate tutte le funzioni nel file di configurazione {0} prima di eseguire Sophia Script? +DefenderBroken = \nMicrosoft Defender rimosso dal sistema ControlledFolderAccessDisabled = l'accesso alle cartelle controllata disattivata ScheduledTasks = Attività pianificate OneDriveUninstalling = Disinstallazione di OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/pt-BR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/pt-BR/Sophia.psd1 index c5b22eeb..d974fb44 100644 --- a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/pt-BR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/pt-BR/Sophia.psd1 @@ -11,6 +11,7 @@ bin = Não existem ficheiros na pasta bin. RebootPending = O PC está esperando para ser reiniciado UnsupportedRelease = Nova versão encontrada CustomizationWarning = \nVocê personalizou todas as funções no arquivo de predefinição {0} antes de executar o Sophia Script? +DefenderBroken = \nMicrosoft Defender quebrado ou removido do sistema operativo ControlledFolderAccessDisabled = Acesso controlado a pasta desativada ScheduledTasks = Tarefas agendadas OneDriveUninstalling = Desinstalar OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/ru-RU/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/ru-RU/Sophia.psd1 index 54591c9d..074649da 100644 --- a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/ru-RU/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/ru-RU/Sophia.psd1 @@ -11,6 +11,7 @@ bin = В папке bin отсутству RebootPending = Компьютер ожидает перезагрузки UnsupportedRelease = Обнаружена новая версия CustomizationWarning = \nВы настроили все функции в пресет-файле {0} перед запуском Sophia Script? +DefenderBroken = \nMicrosoft Defender сломан или удален из ОС ControlledFolderAccessDisabled = Контролируемый доступ к папкам выключен ScheduledTasks = Запланированные задания OneDriveUninstalling = Удаление OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/tr-TR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/tr-TR/Sophia.psd1 index c554d47c..7bcb5dd3 100644 --- a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/tr-TR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/tr-TR/Sophia.psd1 @@ -11,6 +11,7 @@ bin = bin klasöründe dosya yok. Lütfen RebootPending = PC yeniden başlatılmayı bekliyor UnsupportedRelease = Yeni sürüm bulundu CustomizationWarning = \nSophia Script'i çalıştırmadan önce {0} ön ayar dosyasındaki her işlevi özelleştirdiniz mi? +DefenderBroken = \nMicrosoft Defender bozuk veya işletim sisteminden kaldırıldı ControlledFolderAccessDisabled = Kontrollü klasör erişimi devre dışı bırakıldı ScheduledTasks = Zamanlanan görevler OneDriveUninstalling = OneDrive kaldırılıyor... diff --git a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/uk-UA/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/uk-UA/Sophia.psd1 index 7e779fe5..8102b239 100644 --- a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/uk-UA/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/uk-UA/Sophia.psd1 @@ -11,6 +11,7 @@ bin = У папці bin немає фай RebootPending = Комп'ютер очікує на перезавантаження UnsupportedRelease = Виявлено нову версію CustomizationWarning = \nВи налаштували всі функції в пресет-файлі {0} перед запуском Sophia Script? +DefenderBroken = \nMicrosoft Defender пошкоджено або видалено з ОС ControlledFolderAccessDisabled = Контрольований доступ до папок вимкнений ScheduledTasks = Заплановані задачі OneDriveUninstalling = Видалення OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/zh-CN/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/zh-CN/Sophia.psd1 index 48466923..d2238c87 100644 --- a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/zh-CN/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Localizations/zh-CN/Sophia.psd1 @@ -11,6 +11,7 @@ bin = bin文件夹中没有文件。请重 RebootPending = 计算机正在等待重新启动 UnsupportedRelease = 找到新版本 CustomizationWarning = \n在运行Sophia Script之前,您是否已自定义{0}预设文件中的每个函数? +DefenderBroken = \n微软卫士被破坏或从操作系统中删除 ControlledFolderAccessDisabled = “受控文件夹访问”已禁用 ScheduledTasks = 计划任务 OneDriveUninstalling = 卸载OneDrive…… diff --git a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Module/Sophia.psm1 b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Module/Sophia.psm1 index 21b83ebc..be5bd21f 100644 --- a/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Module/Sophia.psm1 +++ b/Sophia Script/Sophia Script for Windows 11 PowerShell 7/Module/Sophia.psm1 @@ -273,41 +273,6 @@ function Checkings # Unblock all files in the script folder by removing the Zone.Identifier alternate data stream with a value of "3" Get-ChildItem -Path $PSScriptRoot\..\ -File -Recurse -Force | Unblock-File - # Display a warning message about whether a user has customized the preset file - if ($Warning) - { - # Get the name of a preset (e.g Sophia.ps1) regardless it was named - $PresetName = Split-Path -Path ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File -match ".ps1"}).File -Leaf - - $Title = "" - $Message = $Localization.CustomizationWarning -f $PresetName - $Yes = $Localization.Yes - $No = $Localization.No - $Options = "&$No", "&$Yes" - $DefaultChoice = 0 - $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) - - switch ($Result) - { - "0" - { - Invoke-Item -Path $PSScriptRoot\..\$PresetName - - Start-Sleep -Seconds 5 - - Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#how-to-use" - exit - } - "1" - { - continue - } - } - } - - # Import PowerShell 5.1 modules - Import-Module -Name Microsoft.PowerShell.Management, PackageManagement, Appx -UseWindowsPowerShell - # Turn off Controlled folder access to let the script proceed # Checking whether Defender wasn't disabled first $productState = (Get-CimInstance -Namespace root/SecurityCenter2 -ClassName Antivirusproduct | Where-Object -FilterScript {$_.instanceGuid -eq "{D68DDC3A-831F-4fae-9E44-DA132C1ACF46}"}).productState @@ -322,14 +287,22 @@ function Checkings } # Checking services - Get-Service -Name Windefend, SecurityHealthService, wscsvc -ErrorAction Ignore | ForEach-Object -Process { - if (($null -ne $_.Name) -and ($_.Status -eq "running")) + @("Windefend", "SecurityHealthService", "wscsvc") | ForEach-Object -Process { + if ($null -eq (Get-Service -Name $_ -ErrorAction Ignore)) { - $Script:DefenderServices = $true + $Localization.DefenderBroken + exit } else { - $Script:DefenderServices = $false + if ((Get-Service -Name $_ -ErrorAction Ignore).Status -eq "running") + { + $Script:DefenderServices = $true + } + else + { + $Script:DefenderServices = $false + } } } @@ -353,7 +326,7 @@ function Checkings } # https://docs.microsoft.com/en-us/graph/api/resources/intune-devices-windowsdefenderproductstatus?view=graph-rest-beta - if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AMEngineVersion -eq 0.0.0.0) + if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AMEngineVersion -eq "0.0.0.0") { $Script:DefenderAMEngineVersion = $false } @@ -387,6 +360,41 @@ function Checkings } #endregion Defender Checkings + # Display a warning message about whether a user has customized the preset file + if ($Warning) + { + # Get the name of a preset (e.g Sophia.ps1) regardless it was named + $PresetName = Split-Path -Path ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File -match ".ps1"}).File -Leaf + + $Title = "" + $Message = $Localization.CustomizationWarning -f $PresetName + $Yes = $Localization.Yes + $No = $Localization.No + $Options = "&$No", "&$Yes" + $DefaultChoice = 0 + $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) + + switch ($Result) + { + "0" + { + Invoke-Item -Path $PSScriptRoot\..\$PresetName + + Start-Sleep -Seconds 5 + + Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#how-to-use" + exit + } + "1" + { + continue + } + } + } + + # Import PowerShell 5.1 modules + Import-Module -Name Microsoft.PowerShell.Management, PackageManagement, Appx -UseWindowsPowerShell + # Save all opened folders in order to restore them after File Explorer restart $Script:OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke() } @@ -11338,8 +11346,8 @@ function DNSoverHTTPS else { # Set a primary and secondary DNS servers - Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq "0.0.0.0/0"} | Get-NetAdapter | Set-DnsClientServerAddress -ServerAddresses $PrimaryDNS, $SecondaryDNS - $InterfaceGuid = (Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq "0.0.0.0/0"} | Get-NetAdapter).InterfaceGuid + Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq ""0.0.0.0"/0"} | Get-NetAdapter | Set-DnsClientServerAddress -ServerAddresses $PrimaryDNS, $SecondaryDNS + $InterfaceGuid = (Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq ""0.0.0.0"/0"} | Get-NetAdapter).InterfaceGuid } # Set the DNS servers @@ -11369,7 +11377,7 @@ function DNSoverHTTPS else { # Configure DNS servers automatically - Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq "0.0.0.0/0"} | Get-NetAdapter | Set-DnsClientServerAddress -ResetServerAddresses + Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq ""0.0.0.0"/0"} | Get-NetAdapter | Set-DnsClientServerAddress -ResetServerAddresses } Remove-Item -Path "HKLM:\SYSTEM\ControlSet001\Services\Dnscache\InterfaceSpecificParameters\*" -Recurse -Force -ErrorAction Ignore diff --git a/Sophia Script/Sophia Script for Windows 11/Localizations/de-DE/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11/Localizations/de-DE/Sophia.psd1 index b7990129..82a9b345 100644 --- a/Sophia Script/Sophia Script for Windows 11/Localizations/de-DE/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11/Localizations/de-DE/Sophia.psd1 @@ -7,10 +7,11 @@ UnsupportedPowerShell = Sie versuchen ein Skript über Power UnsupportedISE = Das Skript unterstützt nicht die Ausführung über Windows PowerShell ISE Win10TweakerWarning = Wahrscheinlich wurde Ihr Betriebssystem über die Win 10 Tweaker-Hintertür infiziert Windows10DebloaterWarning = Die Stabilität des Windows-Betriebssystems kann durch die Verwendung des Windows10Debloater PowerShell-Skripts von Sycnex beeinträchtigt worden sein. Installieren Sie vorsorglich das gesamte Betriebssystem neu -bin = Im Ordner bin befinden sich keine Dateien. Bitte das Archiv erneut herunterladen +bin = Im Ordner "bin" befinden sich keine Dateien. Bitte das Archiv erneut herunterladen RebootPending = Der PC wartet darauf, neu gestartet zu werden UnsupportedRelease = Neue Version gefunden CustomizationWarning = \nHaben Sie alle Funktionen in der voreingestellten Datei {0} angepasst, bevor Sie Sophia Script ausführen? +DefenderBroken = \nMicrosoft Defender defekt oder aus dem Betriebssystem entfernt ControlledFolderAccessDisabled = Kontrollierter Ordnerzugriff deaktiviert ScheduledTasks = Geplante Aufgaben OneDriveUninstalling = OneDrive deinstallieren… @@ -38,7 +39,7 @@ GraphicsPerformanceTitle = Bevorzugte Grafikleistung GraphicsPerformanceRequest = Möchten Sie die Einstellung der Grafikleistung einer App Ihrer Wahl auf "Hohe Leistung" einstellen? TaskNotificationTitle = Benachrichtigung CleanupTaskNotificationTitle = Wichtige Informationen -CleanupTaskDescription = Bereinigung von nicht verwendeten Windows-Dateien und Updates mit der integrierten Festplattenbereinigung +CleanupTaskDescription = Bereinigung von nicht verwendeten Windows-Dateien und Updates mit der integrierten Festplattenbereinigung CleanupTaskNotificationEventTitle = Aufgabe zum Bereinigen nicht verwendeter Windows-Dateien und -Updates ausführen? CleanupTaskNotificationEvent = Die Bereinigung von Windows wird nicht lange dauern. Das nächste Mal wird diese Benachrichtigung in 30 Tagen erscheinen CleanupTaskNotificationSnoozeInterval = Ein Erinnerungsintervall auswählen diff --git a/Sophia Script/Sophia Script for Windows 11/Localizations/en-US/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11/Localizations/en-US/Sophia.psd1 index 5fa96f46..cb4151c0 100644 --- a/Sophia Script/Sophia Script for Windows 11/Localizations/en-US/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11/Localizations/en-US/Sophia.psd1 @@ -11,6 +11,7 @@ bin = There are no files in the bin folder RebootPending = The PC is waiting to be restarted UnsupportedRelease = A new version found CustomizationWarning = \nHave you customized every function in the {0} preset file before running Sophia Script? +DefenderBroken = \nMicrosoft Defender broken or removed from the OS ControlledFolderAccessDisabled = Controlled folder access disabled ScheduledTasks = Scheduled tasks OneDriveUninstalling = Uninstalling OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 11/Localizations/es-ES/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11/Localizations/es-ES/Sophia.psd1 index 1b98e760..3cd2b9d6 100644 --- a/Sophia Script/Sophia Script for Windows 11/Localizations/es-ES/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11/Localizations/es-ES/Sophia.psd1 @@ -11,6 +11,7 @@ bin = No hay archivos en la carpeta bin. P RebootPending = El PC está esperando a ser reiniciado UnsupportedRelease = Una nueva versión encontrada CustomizationWarning = \n¿Ha personalizado todas las funciones del archivo predeterminado {0} antes de ejecutar Sophia Script? +DefenderBroken = \nMicrosoft Defender defekt oder aus dem Betriebssystem entfernt ControlledFolderAccessDisabled = Acceso a la carpeta controlada deshabilitado ScheduledTasks = Tareas programadas OneDriveUninstalling = Desinstalar OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 11/Localizations/fr-FR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11/Localizations/fr-FR/Sophia.psd1 index 8af90cd3..31e22e0d 100644 --- a/Sophia Script/Sophia Script for Windows 11/Localizations/fr-FR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11/Localizations/fr-FR/Sophia.psd1 @@ -7,10 +7,11 @@ UnsupportedPowerShell = Vous essayez d'exécuter le script v UnsupportedISE = Le script ne supporte pas l'exécution via Windows PowerShell ISE Win10TweakerWarning = Votre système d'exploitation a probablement été infecté par la porte dérobée Win 10 Tweaker Windows10DebloaterWarning = La stabilité de l'OS Windows peut avoir été compromise par l'utilisation du script PowerShell Windows10Debloater de Sycnex. De manière préventive, réinstallez l'ensemble de l'OS - bin = Il n'y a pas de fichiers dans le dossier bin. Veuillez retélécharger l'archive +bin = Il n'y a pas de fichiers dans le dossier bin. Veuillez retélécharger l'archive RebootPending = Le PC attend d'être redémarré UnsupportedRelease = Nouvelle version trouvée CustomizationWarning = \nAvez-vous personnalisé chaque fonction du fichier de préréglage {0} avant d'exécuter Sophia Script? +DefenderBroken = \nMicrosoft Defender cassé ou supprimé du système d'exploitation ControlledFolderAccessDisabled = Contrôle d'accès aux dossiers désactivé ScheduledTasks = Tâches planifiées OneDriveUninstalling = Désinstalltion de OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 11/Localizations/hu-HU/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11/Localizations/hu-HU/Sophia.psd1 index dc73e9d3..ce1eaa32 100644 --- a/Sophia Script/Sophia Script for Windows 11/Localizations/hu-HU/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11/Localizations/hu-HU/Sophia.psd1 @@ -11,6 +11,7 @@ bin = A bin mappában nincsenek fájlok. K RebootPending = A számítógép újraindításra vár UnsupportedRelease = Új verzió érhető el CustomizationWarning = \nSzemélyre szabott minden opciót a {0} preset fájlban, mielőtt futtatni kívánja a Sophia szkriptet? +DefenderBroken = \nA Microsoft Defender elromlott vagy eltávolították az operációs rendszerből ControlledFolderAccessDisabled = Vezérelt mappához való hozzáférés kikapcsolva ScheduledTasks = Ütemezett feladatok OneDriveUninstalling = OneDrive eltávolítása... diff --git a/Sophia Script/Sophia Script for Windows 11/Localizations/it-IT/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11/Localizations/it-IT/Sophia.psd1 index f7e8b0da..d8a1ac8b 100644 --- a/Sophia Script/Sophia Script for Windows 11/Localizations/it-IT/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11/Localizations/it-IT/Sophia.psd1 @@ -11,6 +11,7 @@ bin = Non ci sono file nella cartella bin. RebootPending = Il PC è in attesa di essere riavviato UnsupportedRelease = Nuova versione trovata CustomizationWarning = \nSono state personalizzate tutte le funzioni nel file di configurazione {0} prima di eseguire Sophia Script? +DefenderBroken = \nMicrosoft Defender rimosso dal sistema ControlledFolderAccessDisabled = l'accesso alle cartelle controllata disattivata ScheduledTasks = Attività pianificate OneDriveUninstalling = Disinstallazione di OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 11/Localizations/pt-BR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11/Localizations/pt-BR/Sophia.psd1 index 4db9660f..9ac91d8c 100644 --- a/Sophia Script/Sophia Script for Windows 11/Localizations/pt-BR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11/Localizations/pt-BR/Sophia.psd1 @@ -11,6 +11,7 @@ bin = Não existem ficheiros na pasta bin. RebootPending = O PC está esperando para ser reiniciado UnsupportedRelease = Nova versão encontrada CustomizationWarning = \nVocê personalizou todas as funções no arquivo de predefinição {0} antes de executar o Sophia Script? +DefenderBroken = \nMicrosoft Defender quebrado ou removido do sistema operativo ControlledFolderAccessDisabled = Acesso controlado a pasta desativada ScheduledTasks = Tarefas agendadas OneDriveUninstalling = Desinstalar OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 11/Localizations/ru-RU/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11/Localizations/ru-RU/Sophia.psd1 index 5f0e92f0..7a262dad 100644 --- a/Sophia Script/Sophia Script for Windows 11/Localizations/ru-RU/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11/Localizations/ru-RU/Sophia.psd1 @@ -11,6 +11,7 @@ bin = В папке bin отсутству RebootPending = Компьютер ожидает перезагрузки UnsupportedRelease = Обнаружена новая версия CustomizationWarning = \nВы настроили все функции в пресет-файле {0} перед запуском Sophia Script? +DefenderBroken = \nMicrosoft Defender сломан или удален из ОС ControlledFolderAccessDisabled = Контролируемый доступ к папкам выключен ScheduledTasks = Запланированные задания OneDriveUninstalling = Удаление OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 11/Localizations/tr-TR/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11/Localizations/tr-TR/Sophia.psd1 index 4640968e..521fdc7c 100644 --- a/Sophia Script/Sophia Script for Windows 11/Localizations/tr-TR/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11/Localizations/tr-TR/Sophia.psd1 @@ -11,6 +11,7 @@ bin = bin klasöründe dosya yok. Lütfen RebootPending = PC yeniden başlatılmayı bekliyor UnsupportedRelease = Yeni sürüm bulundu CustomizationWarning = \nSophia Script'i çalıştırmadan önce {0} ön ayar dosyasındaki her işlevi özelleştirdiniz mi? +DefenderBroken = \nMicrosoft Defender bozuk veya işletim sisteminden kaldırıldı ControlledFolderAccessDisabled = Kontrollü klasör erişimi devre dışı bırakıldı ScheduledTasks = Zamanlanan görevler OneDriveUninstalling = OneDrive kaldırılıyor... diff --git a/Sophia Script/Sophia Script for Windows 11/Localizations/uk-UA/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11/Localizations/uk-UA/Sophia.psd1 index 37ff4f58..f6594ec2 100644 --- a/Sophia Script/Sophia Script for Windows 11/Localizations/uk-UA/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11/Localizations/uk-UA/Sophia.psd1 @@ -11,6 +11,7 @@ bin = У папці bin немає фай RebootPending = Комп'ютер очікує на перезавантаження UnsupportedRelease = Виявлено нову версію CustomizationWarning = \nВи налаштували всі функції в пресет-файлі {0} перед запуском Sophia Script? +DefenderBroken = \nMicrosoft Defender пошкоджено або видалено з ОС ControlledFolderAccessDisabled = Контрольований доступ до папок вимкнений ScheduledTasks = Заплановані задачі OneDriveUninstalling = Видалення OneDrive... diff --git a/Sophia Script/Sophia Script for Windows 11/Localizations/zh-CN/Sophia.psd1 b/Sophia Script/Sophia Script for Windows 11/Localizations/zh-CN/Sophia.psd1 index 6b181689..836fdfdc 100644 --- a/Sophia Script/Sophia Script for Windows 11/Localizations/zh-CN/Sophia.psd1 +++ b/Sophia Script/Sophia Script for Windows 11/Localizations/zh-CN/Sophia.psd1 @@ -11,6 +11,7 @@ bin = bin文件夹中没有文件。请重 RebootPending = 计算机正在等待重新启动 UnsupportedRelease = 找到新版本 CustomizationWarning = \n在运行Sophia Script之前,您是否已自定义{0}预设文件中的每个函数? +DefenderBroken = \n微软卫士被破坏或从操作系统中删除 ControlledFolderAccessDisabled = “受控文件夹访问”已禁用 ScheduledTasks = 计划任务 OneDriveUninstalling = 卸载OneDrive…… diff --git a/Sophia Script/Sophia Script for Windows 11/Module/Sophia.psm1 b/Sophia Script/Sophia Script for Windows 11/Module/Sophia.psm1 index ead6ad24..3ffc9d76 100644 --- a/Sophia Script/Sophia Script for Windows 11/Module/Sophia.psm1 +++ b/Sophia Script/Sophia Script for Windows 11/Module/Sophia.psm1 @@ -271,38 +271,6 @@ function Checkings # Unblock all files in the script folder by removing the Zone.Identifier alternate data stream with a value of "3" Get-ChildItem -Path $PSScriptRoot\..\ -File -Recurse -Force | Unblock-File - # Display a warning message about whether a user has customized the preset file - if ($Warning) - { - # Get the name of a preset (e.g Sophia.ps1) regardless it was named - $PresetName = Split-Path -Path ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File -match ".ps1"}).File -Leaf - - $Title = "" - $Message = $Localization.CustomizationWarning -f $PresetName - $Yes = $Localization.Yes - $No = $Localization.No - $Options = "&$No", "&$Yes" - $DefaultChoice = 0 - $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) - - switch ($Result) - { - "0" - { - Invoke-Item -Path $PSScriptRoot\..\$PresetName - - Start-Sleep -Seconds 5 - - Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#how-to-use" - exit - } - "1" - { - continue - } - } - } - #region Defender Checkings # Turn off Controlled folder access to let the script proceed # Checking whether Defender wasn't disabled first @@ -318,14 +286,22 @@ function Checkings } # Checking services - Get-Service -Name Windefend, SecurityHealthService, wscsvc -ErrorAction Ignore | ForEach-Object -Process { - if (($null -ne $_.Name) -and ($_.Status -eq "running")) + @("Windefend", "SecurityHealthService", "wscsvc") | ForEach-Object -Process { + if ($null -eq (Get-Service -Name $_ -ErrorAction Ignore)) { - $Script:DefenderServices = $true + $Localization.DefenderBroken + exit } else { - $Script:DefenderServices = $false + if ((Get-Service -Name $_ -ErrorAction Ignore).Status -eq "running") + { + $Script:DefenderServices = $true + } + else + { + $Script:DefenderServices = $false + } } } @@ -349,7 +325,7 @@ function Checkings } # https://docs.microsoft.com/en-us/graph/api/resources/intune-devices-windowsdefenderproductstatus?view=graph-rest-beta - if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AMEngineVersion -eq 0.0.0.0) + if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AMEngineVersion -eq "0.0.0.0") { $Script:DefenderAMEngineVersion = $false } @@ -383,6 +359,38 @@ function Checkings } #endregion Defender Checkings + # Display a warning message about whether a user has customized the preset file + if ($Warning) + { + # Get the name of a preset (e.g Sophia.ps1) regardless it was named + $PresetName = Split-Path -Path ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File -match ".ps1"}).File -Leaf + + $Title = "" + $Message = $Localization.CustomizationWarning -f $PresetName + $Yes = $Localization.Yes + $No = $Localization.No + $Options = "&$No", "&$Yes" + $DefaultChoice = 0 + $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) + + switch ($Result) + { + "0" + { + Invoke-Item -Path $PSScriptRoot\..\$PresetName + + Start-Sleep -Seconds 5 + + Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#how-to-use" + exit + } + "1" + { + continue + } + } + } + # Save all opened folders in order to restore them after File Explorer restart $Script:OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke() } @@ -11298,8 +11306,8 @@ function DNSoverHTTPS else { # Set a primary and secondary DNS servers - Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq "0.0.0.0/0"} | Get-NetAdapter | Set-DnsClientServerAddress -ServerAddresses $PrimaryDNS, $SecondaryDNS - $InterfaceGuid = (Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq "0.0.0.0/0"} | Get-NetAdapter).InterfaceGuid + Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq ""0.0.0.0"/0"} | Get-NetAdapter | Set-DnsClientServerAddress -ServerAddresses $PrimaryDNS, $SecondaryDNS + $InterfaceGuid = (Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq ""0.0.0.0"/0"} | Get-NetAdapter).InterfaceGuid } # Set the DNS servers @@ -11329,7 +11337,7 @@ function DNSoverHTTPS else { # Configure DNS servers automatically - Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq "0.0.0.0/0"} | Get-NetAdapter | Set-DnsClientServerAddress -ResetServerAddresses + Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq ""0.0.0.0"/0"} | Get-NetAdapter | Set-DnsClientServerAddress -ResetServerAddresses } Remove-Item -Path "HKLM:\SYSTEM\ControlSet001\Services\Dnscache\InterfaceSpecificParameters\*" -Recurse -Force -ErrorAction Ignore diff --git a/Wrapper/SophiaScriptWrapper.exe b/Wrapper/SophiaScriptWrapper.exe index 6bf20494..93010f45 100644 Binary files a/Wrapper/SophiaScriptWrapper.exe and b/Wrapper/SophiaScriptWrapper.exe differ