diff --git a/Sophia/LTSC/Functions.ps1 b/Sophia/LTSC/Functions.ps1 index a53d1743..174c7967 100644 --- a/Sophia/LTSC/Functions.ps1 +++ b/Sophia/LTSC/Functions.ps1 @@ -2,8 +2,8 @@ .SYNOPSIS The TAB completion for functions and their arguments - Version: v5.2.8 - Date: 20.06.2021 + Version: v5.2.9 + Date: 12.07.2021 Copyright (c) 2014–2021 farag Copyright (c) 2019–2021 farag & Inestic @@ -26,20 +26,6 @@ .NOTES Separate functions with a comma - .NOTES - https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15 - https://habr.com/post/521202/ - https://forums.mydigitallife.net/threads/powershell-windows-10-sophia-script.81675/ - https://www.reddit.com/r/PowerShell/comments/go2n5v/powershell_script_setup_windows_10/ - - .LINK - https://t.me/sophianews - https://t.me/sophia_chat - - .LINK - https://github.com/farag2 - https://github.com/Inestic - .LINK https://github.com/farag2/Windows-10-Sophia-Script #> @@ -53,7 +39,6 @@ function Sophia $Functions ) - # Regardless of the functions entered as an argument, the "Checkings" function will be executed first, and the "RefreshEnvironment" and "Errors" functions will be executed at the end Invoke-Command -ScriptBlock {Checkings} foreach ($Function in $Functions) @@ -61,6 +46,7 @@ function Sophia Invoke-Expression -Command $Function } + # The "RefreshEnvironment" and "Errors" functions will be executed at the end Invoke-Command -ScriptBlock {RefreshEnvironment; Errors} } @@ -92,49 +78,6 @@ $Parameters = @{ { $ParameterSets = (Get-Command -Name $Command).Parametersets.Parameters | Where-Object -FilterScript {$null -eq $_.Attributes.AliasNames} - # If a module command is PinToStart - if ($Command -eq "PinToStart") - { - # Get all command arguments, excluding defaults - foreach ($ParameterSet in $ParameterSets.Name) - { - # If an argument is Tiles - if ($ParameterSet -eq "Tiles") - { - $ValidValues = ((Get-Command -Name PinToStart).Parametersets.Parameters | Where-Object -FilterScript {$null -eq $_.Attributes.AliasNames}).Attributes.ValidValues - foreach ($ValidValue in $ValidValues) - { - # The "PinToStart -Tiles " construction - "PinToStart" + " " + "-" + $ParameterSet + " " + $ValidValue | Where-Object -FilterScript {$_ -like "*$wordToComplete*"} | ForEach-Object -Process {"`"$_`""} - } - - # The "PinToStart -Tiles " construction - "PinToStart" + " " + "-" + $ParameterSet + " " + ($ValidValues -join ", ") | Where-Object -FilterScript {$_ -like "*$wordToComplete*"} | ForEach-Object -Process {"`"$_`""} - } - - continue - } - } - - # If a module command is UninstallUWPApps - if ($Command -eq "UninstallUWPApps") - { - (Get-Command -Name $Command).Name | Where-Object -FilterScript {$_ -like "*$wordToComplete*"} - - # Get all command arguments, excluding defaults - foreach ($ParameterSet in $ParameterSets.Name) - { - # If an argument is ForAllUsers - if ($ParameterSet -eq "ForAllUsers") - { - # The "UninstallUWPApps -ForAllUsers" construction - "UninstallUWPApps" + " " + "-" + $ParameterSet | Where-Object -FilterScript {$_ -like "*$wordToComplete*"} | ForEach-Object -Process {"`"$_`""} - } - - continue - } - } - foreach ($ParameterSet in $ParameterSets.Name) { # The "Function -Argument" construction @@ -157,4 +100,4 @@ Write-Verbose -Message "Sophia -Functions " -Verbose Write-Verbose -Message "Sophia -Functions temp" -Verbose Write-Verbose -Message "Sophia -Functions `"DiagTrackService -Disable`", `"DiagnosticDataLevel -Minimal`", UninstallUWPApps" -Verbose Write-Information -MessageData "`n" -InformationAction Continue -Write-Verbose -Message "UninstallUWPApps, `"PinToStart -UnpinAll`"" -Verbose +Write-Verbose -Message "`"Set-Association -ProgramPath ```"%ProgramFiles%\Notepad++\notepad++.exe```" -Extension .txt -Icon ```"%ProgramFiles%\Notepad++\notepad++.exe,0```"`"" -Verbose diff --git a/Sophia/LTSC/Localizations/de-DE/Sophia.psd1 b/Sophia/LTSC/Localizations/de-DE/Sophia.psd1 index 445dcf2c..31509f64 100644 --- a/Sophia/LTSC/Localizations/de-DE/Sophia.psd1 +++ b/Sophia/LTSC/Localizations/de-DE/Sophia.psd1 @@ -1,7 +1,10 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Das Skript unterstützt nur Windows 10 x64 UnsupportedOSBuild = Das Skript unterstützt Windows 10 1809 Enterprise LTSC +UnsupportedLanguageMode = Die PowerShell-Sitzung wird in einem eingeschränkten Sprachmodus ausgeführt +LoggedInUserNotAdmin = Der angemeldete Benutzer hat keine Administratorrechte 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 UnsupportedRelease = Neue Version gefunden CustomizationWarning = \nHaben Sie alle Funktionen in der voreingestellten Datei Sophia.ps1 angepasst, bevor Sie Sophia Script ausführen? ControlledFolderAccessDisabled = Kontrollierter Ordnerzugriff deaktiviert @@ -27,18 +30,9 @@ CleanupNotificationTaskDescription = Bereinigung ungenutzter Windows-Date SoftwareDistributionTaskNotificationEvent = Der Windows Update-Cache wurde erfolgreich gelöscht TempTaskNotificationEvent = Der Ordner mit den temporären Dateien wurde erfolgreich bereinigt FolderTaskDescription = Die Bereinigung des Ordners "{0}" -ControlledFolderAccess = Kontrollierter Ordner-Zugriff -ProtectedFoldersRequest = Möchten Sie den kontrollierten Ordnerzugriff aktivieren und den Ordner angeben, den Microsoft Defender vor bösartigen Anwendungen und Bedrohungen schützen soll? -ProtectedFoldersListRemoved = Gelöschte Ordner -AppControlledFolderRequest = Möchten Sie eine Anwendung angeben, die über den Zugriff auf Kontrollierte Ordner erlaubt ist? -AllowedControlledFolderAppsRemoved = Erlaubte Anwendungen entfernt -DefenderExclusionFolderRequest = Möchten Sie einen Ordner angeben, der von den Malware-Scans von Microsoft Defender ausgeschlossen werden soll? -DefenderExclusionFoldersListRemoved = Ausgeschlossene Ordner entfernt -AddDefenderExclusionFileRequest = Möchten Sie eine Datei angeben, die von den Malware-Scans von Microsoft Defender ausgeschlossen werden soll? -DefenderExclusionFilesRemoved = Ausgeschlossene Dateien entfernt EventViewerCustomViewName = Prozess-Erstellung EventViewerCustomViewDescription = Ereignisse zur Prozesserstellung und Befehlszeilen-Auditierung -RestartWarning = Achten Sie darauf, Ihren PC neu zu starten +RestartWarning = \nAchten Sie darauf, Ihren PC neu zu starten ErrorsLine = Zeile ErrorsFile = Datei ErrorsMessage = Fehler/Warnungen diff --git a/Sophia/LTSC/Localizations/en-US/Sophia.psd1 b/Sophia/LTSC/Localizations/en-US/Sophia.psd1 index f950aadc..65c54281 100644 --- a/Sophia/LTSC/Localizations/en-US/Sophia.psd1 +++ b/Sophia/LTSC/Localizations/en-US/Sophia.psd1 @@ -1,7 +1,10 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = The script supports Windows 10 x64 only UnsupportedOSBuild = The script supports Windows 10 1809 Enterprise LTSC +UnsupportedLanguageMode = The PowerShell session in running in a limited language mode +LoggedInUserNotAdmin = The logged-on user doesn't have admin rights UnsupportedISE = The script doesn't support running via Windows PowerShell ISE +Win10TweakerWarning = Probably your OS was infected via the Win 10 Tweaker backdoor UnsupportedRelease = A new version found CustomizationWarning = \nHave you customized every function in the Sophia.ps1 preset file before running Sophia Script? ControlledFolderAccessDisabled = Controlled folder access disabled @@ -27,18 +30,9 @@ CleanupNotificationTaskDescription = Pop-up notification reminder about c SoftwareDistributionTaskNotificationEvent = The Windows update cache successfully deleted TempTaskNotificationEvent = The temp files folder successfully cleaned up FolderTaskDescription = The {0} folder cleanup -ControlledFolderAccess = Controlled folder access -ProtectedFoldersRequest = Would you like to enable Controlled folder access and specify the folder that Microsoft Defender will protect from malicious apps and threats? -ProtectedFoldersListRemoved = Removed folders -AppControlledFolderRequest = Would you like to specify an app that is allowed through Controlled Folder access? -AllowedControlledFolderAppsRemoved = Removed allowed apps -DefenderExclusionFolderRequest = Would you like to specify a folder to be excluded from Microsoft Defender malware scans? -DefenderExclusionFoldersListRemoved = Excluded folders removed -AddDefenderExclusionFileRequest = Would you like to specify a file to be excluded from Microsoft Defender malware scans? -DefenderExclusionFilesRemoved = Excluded files removed EventViewerCustomViewName = Process Creation EventViewerCustomViewDescription = Process creation and command-line auditing events -RestartWarning = Make sure to restart your PC +RestartWarning = \nMake sure to restart your PC ErrorsLine = Line ErrorsFile = File ErrorsMessage = Errors/Warnings diff --git a/Sophia/LTSC/Localizations/es-ES/Sophia.psd1 b/Sophia/LTSC/Localizations/es-ES/Sophia.psd1 index bd03470e..0df268d9 100644 --- a/Sophia/LTSC/Localizations/es-ES/Sophia.psd1 +++ b/Sophia/LTSC/Localizations/es-ES/Sophia.psd1 @@ -1,8 +1,11 @@ ConvertFrom-StringData -StringData @' -UnsupportedOSBitness = Este script solo soporta Windows 10 x64 -UnsupportedOSBuild = Este script solo soporta Windows 10 1809 Enterprise LTSC +UnsupportedOSBitness = El script sólo es compatible con Windows 10 x64 +UnsupportedOSBuild = El script es compatible con versión Windows 10 1809 Enterprise LTSC +UnsupportedLanguageMode = Sesión de PowerShell ejecutada en modo de lenguaje limitado +LoggedInUserNotAdmin = El usuario que inició sesión no tiene derechos de administrador UnsupportedISE = El script no es compatible con la ejecución a través de Windows PowerShell ISE -UnsupportedRelease = Nueva versión encontrada +Win10TweakerWarning = Probablemente su sistema operativo fue infectado a través del backdoor Win 10 Tweaker +UnsupportedRelease = Una nueva versión encontrada CustomizationWarning = \n¿Ha personalizado todas las funciones del archivo predeterminado Sophia.ps1 antes de ejecutar Sophia Script? ControlledFolderAccessDisabled = Acceso a la carpeta controlada deshabilitado ScheduledTasks = Tareas programadas @@ -14,7 +17,7 @@ RetrievingDrivesList = Recuperando lista de unidades... DriveSelect = Seleccione la unidad dentro de la raíz de la cual se creó la carpeta "{0}" UserFolderRequest = ¿Le gustaría cambiar la ubicación de la "{0}" carpeta? UserFolderSelect = Seleccione una carpeta para la carpeta "{0}" -UserDefaultFolder = ¿Le gustaría cambiar la ubicación de la carpeta "{0}" al valor predeterminado? +UserDefaultFolder = ¿Le gustaría cambiar la ubicación de la carpeta "{0}" para el valor por defecto? GraphicsPerformanceTitle = Preferencia de rendimiento gráfico GraphicsPerformanceRequest = ¿Le gustaría establecer la configuración de rendimiento gráfico de una aplicación de su elección a "alto rendimiento"? TaskNotificationTitle = Notificación @@ -27,18 +30,9 @@ CleanupNotificationTaskDescription = Pop-up recordatorio de notificacione SoftwareDistributionTaskNotificationEvent = La caché de actualización de Windows eliminado correctamente TempTaskNotificationEvent = Los archivos de la carpeta Temp limpiados con éxito FolderTaskDescription = La limpieza de la carpeta "{0}" -ControlledFolderAccess = Acceso a la carpeta controlada -ProtectedFoldersRequest = ¿Le gustaría permitir el acceso controlado carpeta y especifique la carpeta que Microsoft Defender protegerá de aplicaciones maliciosas y amenazas? -ProtectedFoldersListRemoved = Se han eliminado las carpetas -AppControlledFolderRequest = ¿Le gustaría especificar una aplicación que se le permite el acceso a través de carpetas controladas? -AllowedControlledFolderAppsRemoved = Aplicaciones permitidas eliminadas -DefenderExclusionFolderRequest = ¿Le gustaría especificar una carpeta que se excluyen del análisis de malware Microsoft Defender? -DefenderExclusionFoldersListRemoved = Carpetas excluidas removidas -AddDefenderExclusionFileRequest = ¿Le gustaría especificar un archivo que se excluyen del análisis de malware Microsoft Defender? -DefenderExclusionFilesRemoved = Archivos excluidos eliminados EventViewerCustomViewName = Creación de proceso EventViewerCustomViewDescription = Eventos de auditoría de línea de comandos y creación de procesos -RestartWarning = Asegúrese de reiniciar su PC +RestartWarning = \nAsegúrese de reiniciar su PC ErrorsLine = Línea ErrorsFile = Archivo ErrorsMessage = Errores/Advertencias diff --git a/Sophia/LTSC/Localizations/fr-FR/Sophia.psd1 b/Sophia/LTSC/Localizations/fr-FR/Sophia.psd1 index 1c32cd30..90c8dd52 100644 --- a/Sophia/LTSC/Localizations/fr-FR/Sophia.psd1 +++ b/Sophia/LTSC/Localizations/fr-FR/Sophia.psd1 @@ -1,7 +1,10 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Le script supporte uniquement Windows 10 x64 UnsupportedOSBuild = Le script supporte le version Windows 10 1809 Enterprise LTSC +UnsupportedLanguageMode = La session PowerShell s'exécute dans un mode de langue limité +LoggedInUserNotAdmin = L'utilisateur connecté n'a pas de droits d'administrateur 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 UnsupportedRelease = Nouvelle version trouvée CustomizationWarning = \nAvez-vous personnalisé chaque fonction du fichier de préréglage Sophia.ps1 avant d'exécuter Sophia Script? ControlledFolderAccessDisabled = Contrôle d'accès aux dossiers désactivé @@ -27,18 +30,9 @@ CleanupNotificationTaskDescription = Rappel de notification contextuelle SoftwareDistributionTaskNotificationEvent = Le cache de mise à jour Windows a bien été supprimé TempTaskNotificationEvent = Le dossier des fichiers temporaires a été nettoyé avec succès FolderTaskDescription = Nettoyage du dossier "{0}" -ControlledFolderAccess = Contrôle d'accès aux dossiers -ProtectedFoldersRequest = Souhaitez-vous activer le contrôle d'accès aux dossiers et spécifier le dossier que Microsoft Defender protégera contre les applications malveillantes et les menaces? -ProtectedFoldersListRemoved = Dossiers supprimés -AppControlledFolderRequest = Souhaitez-vous spécifier une application autorisée via le contrôle d'accès aux dossiers? -AllowedControlledFolderAppsRemoved = Applications autorisées supprimées -DefenderExclusionFolderRequest = Souhaitez-vous spécifier un dossier à exclure des analyses de logiciels malveillants de Microsoft Defender? -DefenderExclusionFoldersListRemoved = Dossiers exclus supprimés -AddDefenderExclusionFileRequest = Souhaitez-vous spécifier un fichier à exclure des analyses de logiciels malveillants de Microsoft Defender? -DefenderExclusionFilesRemoved = Fichiers exclus supprimés EventViewerCustomViewName = Création du processus EventViewerCustomViewDescription = Audit des événements de création du processus et de ligne de commande -RestartWarning = Assurez-vous de redémarrer votre PC +RestartWarning = \nAssurez-vous de redémarrer votre PC ErrorsLine = Ligne ErrorsFile = Fichier ErrorsMessage = Erreurs/Avertissements diff --git a/Sophia/LTSC/Localizations/hu-HU/Sophia.psd1 b/Sophia/LTSC/Localizations/hu-HU/Sophia.psd1 index 2a05dcf2..cdde8254 100644 --- a/Sophia/LTSC/Localizations/hu-HU/Sophia.psd1 +++ b/Sophia/LTSC/Localizations/hu-HU/Sophia.psd1 @@ -1,6 +1,8 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = A szkript csak a Windows 10 64 bites verziót támogatja UnsupportedOSBuild = A szkript támogatja a Windows 10 1809 Enterprise LTSC kiadást +UnsupportedLanguageMode = A PowerShell munkamenet korlátozott nyelvi üzemmódban fut +LoggedInUserNotAdmin = A bejelentkezett felhasználó nem rendelkezik admin jogokkal UnsupportedISE = A szkript nem támogatja a "Windows PowerShell ISE" futtatását UnsupportedRelease = Új verzió érhető el CustomizationWarning = \nSzemélyre szabott minden opciót a Sophia.ps1 preset fájlban, mielőtt futtatni kívánja a Sophia szkriptet? @@ -27,18 +29,9 @@ CleanupNotificationTaskDescription = Előugró emlékeztető figyelmeztet SoftwareDistributionTaskNotificationEvent = A Windows frissités számára fenntartott ideiglenes tárhely sikeresen megtisztítva TempTaskNotificationEvent = Az ideiglenes fájlok tárolására szolgáló könyvtár tisztítása sikeresen megtörtént FolderTaskDescription = A {0} könyvtár tisztítása -ControlledFolderAccess = Vezérelt mappához való hozzáférés -ProtectedFoldersRequest = Kívánja engedélyezni a vezérelt mappához való hozzáférest és könyvtárat kijelölni, amit a Microsoft Defender majd megvéd a kártékony alkalmazásoktol es fenyegetésektől? -ProtectedFoldersListRemoved = Eltávolított könyvtárak -AppControlledFolderRequest = Szeretne megadni egy alkalmazást, ami a vezérelt mappához való hozzáférésben engedélyezett? -AllowedControlledFolderAppsRemoved = Engedélyezett alkalmazások eltávolítva -DefenderExclusionFolderRequest = Kíván könyvtárakat kihagyni a Microsoft Defender Malware ellenőrzéséből? -DefenderExclusionFoldersListRemoved = A kihagyott könyvtárak eltávolítva -AddDefenderExclusionFileRequest = Kíván fájlokat kihagyni a Microsoft Defender Malware ellenörzéséből? -DefenderExclusionFilesRemoved = A kihagyott fájlok eltávolítva EventViewerCustomViewName = Folyamatok EventViewerCustomViewDescription = Folyamatok létrehozása és parancssor ellenőrző események -RestartWarning = Kérem ne felejtse el újraindítani a számítógépét +RestartWarning = \nKérem ne felejtse el újraindítani a számítógépét ErrorsLine = Sor ErrorsFile = Fájl ErrorsMessage = Hibák/Figyelmeztetések diff --git a/Sophia/LTSC/Localizations/it-IT/Sophia.psd1 b/Sophia/LTSC/Localizations/it-IT/Sophia.psd1 index b1685f86..9f83fc89 100644 --- a/Sophia/LTSC/Localizations/it-IT/Sophia.psd1 +++ b/Sophia/LTSC/Localizations/it-IT/Sophia.psd1 @@ -1,7 +1,10 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Lo script supporta solo Windows 10 x64 UnsupportedOSBuild = Lo script supporta Windows 10 versione 1809 Enterprise LTSC +UnsupportedLanguageMode = La sessione PowerShell è in esecuzione in una modalità di lingua limitata +LoggedInUserNotAdmin = L'utente connesso non ha i diritti di amministratore UnsupportedISE = Lo script non supporta l'esecuzione tramite Windows PowerShell ISE +Win10TweakerWarning = Probabilmente il tuo sistema operativo è stato infettato tramite la backdoor Win 10 Tweaker UnsupportedRelease = Nuova versione trovata CustomizationWarning = \nSono state personalizzate tutte le funzioni nel file delle preimpostazioni Sophia.ps1 prima di eseguire Sophia Script? ControlledFolderAccessDisabled = l'accesso alle cartelle controllata disattivata @@ -27,18 +30,9 @@ CleanupNotificationTaskDescription = Pop-up promemoria notifica di pulizi SoftwareDistributionTaskNotificationEvent = La cache di aggiornamento di Windows cancellato con successo TempTaskNotificationEvent = I file cartella Temp puliti con successo FolderTaskDescription = La pulizia della cartella "{0}" -ControlledFolderAccess = l'accesso alle cartelle Controlled -ProtectedFoldersRequest = Vuoi per consentire l'accesso alle cartelle Controllata e specificare la cartella in cui Microsoft Defender protegge dalle applicazioni malevoli e minacce? -ProtectedFoldersListRemoved = Cartelle rimossi -AppControlledFolderRequest = Volete specificare un app che è consentito attraverso l'accesso controllato cartella? -AllowedControlledFolderAppsRemoved = Applicazioni consentite rimosse -DefenderExclusionFolderRequest = Volete specificare una cartella da escludere dalla Microsoft Defender scansioni di malware? -DefenderExclusionFoldersListRemoved = Cartelle escluse rimossi -AddDefenderExclusionFileRequest = Volete specificare un file da escludere dalla Microsoft Defender scansioni di malware? -DefenderExclusionFilesRemoved = File esclusi rimossi EventViewerCustomViewName = Creazione di processo EventViewerCustomViewDescription = Creazione di processi ed eventi di controllo della riga di comando -RestartWarning = Assicurarsi di riavviare il PC +RestartWarning = \nAssicurarsi di riavviare il PC ErrorsLine = Linea ErrorsFile = File ErrorsMessage = Errori/avvisi diff --git a/Sophia/LTSC/Localizations/pt-BR/Sophia.psd1 b/Sophia/LTSC/Localizations/pt-BR/Sophia.psd1 index 77e6183c..32aa5e69 100644 --- a/Sophia/LTSC/Localizations/pt-BR/Sophia.psd1 +++ b/Sophia/LTSC/Localizations/pt-BR/Sophia.psd1 @@ -1,7 +1,10 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = O script suporta somente Windows 10 x64 UnsupportedOSBuild = O script suporta versões Windows 10 1809 Enterprise LTSC +UnsupportedLanguageMode = A sessão PowerShell em funcionamento em um modo de linguagem limitada +LoggedInUserNotAdmin = O usuário logado não tem direitos de administrador UnsupportedISE = O guião não suporta a execução através do Windows PowerShell ISE +Win10TweakerWarning = Probabilmente il tuo sistema operativo è stato infettato tramite la backdoor Win 10 Tweaker UnsupportedRelease = Nova versão encontrada CustomizationWarning = \nVocê personalizou todas as funções no arquivo de predefinição Sophia.ps1 antes de executar o Sophia Script? ControlledFolderAccessDisabled = Acesso controlado a pasta desativada @@ -27,18 +30,9 @@ CleanupNotificationTaskDescription = Pop-up lembrete de notificação sob SoftwareDistributionTaskNotificationEvent = O cache de atualização do Windows excluído com sucesso TempTaskNotificationEvent = Os arquivos da pasta Temp limpos com sucesso FolderTaskDescription = A limpeza da pasta "{0}" -ControlledFolderAccess = Acesso à pasta controlada -ProtectedFoldersRequest = Gostaria de permitir o acesso à pasta controlada e especificar a pasta que Microsoft Defender irá proteger de aplicativos maliciosos e ameaças? -ProtectedFoldersListRemoved = Pastas removidas -AppControlledFolderRequest = Gostaria de especificar um aplicativo que é permitido através do acesso pasta controlada? -AllowedControlledFolderAppsRemoved = Aplicações permitidas removidas -DefenderExclusionFolderRequest = Gostaria de especificar uma pasta a ser excluído da Microsoft Defender scans de malware? -DefenderExclusionFoldersListRemoved = Pastas excluídas removidas -AddDefenderExclusionFileRequest = Gostaria de especificar um arquivo a ser excluído do Microsoft Defender scans de malware? -DefenderExclusionFilesRemoved = Arquivos excluídos removidos EventViewerCustomViewName = Criação de processo EventViewerCustomViewDescription = Criação de processos e eventos de auditoria de linha de comando -RestartWarning = Certifique-se de reiniciar o PC +RestartWarning = \nCertifique-se de reiniciar o PC ErrorsLine = Linha ErrorsFile = Arquivo ErrorsMessage = Erros/Avisos @@ -65,7 +59,6 @@ Open = Abrir Patient = Por favor, espere... Restore = Restaurar Run = Executar -Select = Selecione SelectAll = Selecionar tudo Skip = Pular Skipped = Ignorados diff --git a/Sophia/LTSC/Localizations/ru-RU/Sophia.psd1 b/Sophia/LTSC/Localizations/ru-RU/Sophia.psd1 index 67da4b96..634bf8e5 100644 --- a/Sophia/LTSC/Localizations/ru-RU/Sophia.psd1 +++ b/Sophia/LTSC/Localizations/ru-RU/Sophia.psd1 @@ -1,7 +1,10 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Скрипт поддерживает только Windows 10 x64 UnsupportedOSBuild = Скрипт поддерживает только Windows 10 1809 Enterprise LTSC +UnsupportedLanguageMode = Сессия PowerShell работает в ограниченном режиме +LoggedInUserNotAdmin = Текущий вошедший пользователь не обладает правами администратора UnsupportedISE = Скрипт не поддерживает работу через Windows PowerShell ISE +Win10TweakerWarning = Ваша ОС, возможно, через бэкдор в Win 10 Tweaker заражена трояном UnsupportedRelease = Обнаружена новая версия CustomizationWarning = \nВы настроили все функции в пресет-файле Sophia.ps1 перед запуском Sophia Script? ControlledFolderAccessDisabled = Контролируемый доступ к папкам выключен @@ -27,18 +30,9 @@ CleanupNotificationTaskDescription = Всплывающее уведом SoftwareDistributionTaskNotificationEvent = Кэш обновлений Windows успешно удален TempTaskNotificationEvent = Папка временных файлов успешно очищена FolderTaskDescription = Очистка папки {0} -ControlledFolderAccess = Контролируемый доступ к папкам -ProtectedFoldersRequest = Хотите включить контролируемый доступ к папкам и указать папку, которую Microsoft Defender будет защищать от вредоносных приложений и угроз? -ProtectedFoldersListRemoved = Удаленные папки -AppControlledFolderRequest = Указать приложение, которому разрешена работа через контролируемый доступ к папкам -AllowedControlledFolderAppsRemoved = Удаленные разрешенные приложения -DefenderExclusionFolderRequest = Указать папку, чтобы исключить ее из списка сканирования Microsoft Defender? -DefenderExclusionFoldersListRemoved = Исключенные папки удалены -AddDefenderExclusionFileRequest = Указать файл, чтобы исключить его из списка сканирования Microsoft Defender? -DefenderExclusionFilesRemoved = Исключенные файлы удалены EventViewerCustomViewName = Создание процесса EventViewerCustomViewDescription = События содания нового процесса и аудит командной строки -RestartWarning = Обязательно перезагрузите ваш ПК +RestartWarning = \nОбязательно перезагрузите ваш ПК ErrorsLine = Строка ErrorsFile = Файл ErrorsMessage = Ошибки/предупреждения diff --git a/Sophia/LTSC/Localizations/tr-TR/Sophia.psd1 b/Sophia/LTSC/Localizations/tr-TR/Sophia.psd1 index a93a7d5a..1e059a9c 100644 --- a/Sophia/LTSC/Localizations/tr-TR/Sophia.psd1 +++ b/Sophia/LTSC/Localizations/tr-TR/Sophia.psd1 @@ -1,7 +1,10 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Bu betik sadece Windows 10 x64 destekliyor UnsupportedOSBuild = Bu betik sadece Windows 10 1809 Enterprise LTSC +UnsupportedLanguageMode = Sınırlı bir dil modunda çalışan PowerShell oturumu +LoggedInUserNotAdmin = Oturum açan kullanıcının yönetici hakları yok UnsupportedISE = Komut dosyası, Windows PowerShell ISE üzerinden çalıştırmayı desteklemiyor +Win10TweakerWarning = Muhtemelen işletim sisteminize Win 10 Tweaker arka kapısı yoluyla bulaştı UnsupportedRelease = Yeni sürüm bulundu CustomizationWarning = \nSophia Script'i çalıştırmadan önce Sophia.ps1 ön ayar dosyasındaki her işlevi özelleştirdiniz mi? ControlledFolderAccessDisabled = Kontrollü klasör erişimi devre dışı bırakıldı @@ -27,18 +30,9 @@ CleanupNotificationTaskDescription = Windows kullanılmayan dosyaları ve SoftwareDistributionTaskNotificationEvent = Windows güncelleme önbelleği başarıyla silindi TempTaskNotificationEvent = Geçici dosyalar klasörü başarıyla temizlendi FolderTaskDescription = "{0}" klasörü temizleniyor -ControlledFolderAccess = Kontrollü klasör erişimi -ProtectedFoldersRequest = Kontrollü klasör erişimini etkinleştirmek ve Microsoft Defender'ın kötü amaçlı uygulamalardan ve tehditlerden koruyacağı klasörü belirtmek ister misiniz? -ProtectedFoldersListRemoved = Silinen klasörler -AppControlledFolderRequest = Kontrollü Klasör erişimine izin verilen bir uygulama belirtmek ister misiniz? -AllowedControlledFolderAppsRemoved = Tüm kaldırılan uygulamalar -DefenderExclusionFolderRequest = Microsoft Defender kötü amaçlı yazılım taramalarının dışında tutulacak bir klasör belirtmek ister misiniz? -DefenderExclusionFoldersListRemoved = Hariç tutulan klasörler kaldırıldı -AddDefenderExclusionFileRequest = Microsoft Defender kötü amaçlı yazılım taramalarının dışında bırakılacak bir dosya belirtmek ister misiniz? -DefenderExclusionFilesRemoved = Hariç tutulan dosyalar kaldırıldı EventViewerCustomViewName = Süreç Oluşturma EventViewerCustomViewDescription = Süreç oluşturma ve komut satırı denetleme olayları -RestartWarning = Bilgisayarınızı yeniden başlattığınızdan emin olun +RestartWarning = \nBilgisayarınızı yeniden başlattığınızdan emin olun ErrorsLine = Satır ErrorsFile = Dosya ErrorsMessage = Hatalar/Uyarılar diff --git a/Sophia/LTSC/Localizations/uk-UA/Sophia.psd1 b/Sophia/LTSC/Localizations/uk-UA/Sophia.psd1 index 6c4fd65a..0a01cac6 100644 --- a/Sophia/LTSC/Localizations/uk-UA/Sophia.psd1 +++ b/Sophia/LTSC/Localizations/uk-UA/Sophia.psd1 @@ -1,7 +1,10 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Скрипт підтримує тільки Windows 10 x64 UnsupportedOSBuild = Скрипт підтримує тільки Windows 10 1809 версії Enterprise LTSC +UnsupportedLanguageMode = Сесія PowerShell працює в обмеженому режимі +LoggedInUserNotAdmin = Поточний увійшов користувач не володіє правами адміністратора UnsupportedISE = Скрипт не підтримує роботу через Windows PowerShell ISE +Win10TweakerWarning = Ваша ОС, можливо, через бекдор в Win 10 Tweaker заражена трояном UnsupportedRelease = Виявлено нову версію CustomizationWarning = \nВи налаштували всі функції в пресет-файлі Sophia.ps1 перед запуском Sophia Script? ControlledFolderAccessDisabled = Контрольований доступ до папок вимкнений @@ -27,18 +30,9 @@ CleanupNotificationTaskDescription = Спливаюче повідомл SoftwareDistributionTaskNotificationEvent = Кеш оновлень Windows успішно видалений TempTaskNotificationEvent = Папка тимчасових файлів успішно очищена FolderTaskDescription = Очищення папки "{0}" -ControlledFolderAccess = Контрольований доступ до папок -ProtectedFoldersRequest = Бажаєте увімкнути контрольований доступ до папок і вказати папку, яку Microsoft Defender буде захищати від шкідливих додатків і загроз? -ProtectedFoldersListRemoved = Видалення папки -AppControlledFolderRequest = Вказати додаток, якому дозволена робота через контрольований доступ до папок -AllowedControlledFolderAppsRemoved = Видалені дозволені додатки -DefenderExclusionFolderRequest = Вказати папку, щоб виключити її зі списку сканування Microsoft Defender? -DefenderExclusionFoldersListRemoved = Виключені папки видалені -AddDefenderExclusionFileRequest = Вказати файл, щоб виключити його зі списку сканування Microsoft Defender? -DefenderExclusionFilesRemoved = Виключені файли видалені EventViewerCustomViewName = Створення процесу EventViewerCustomViewDescription = Події створення нового процесу і аудит командного рядка -RestartWarning = Обов'язково перезавантажте ваш ПК +RestartWarning = \nОбов'язково перезавантажте ваш ПК ErrorsLine = Рядок ErrorsFile = Файл ErrorsMessage = Помилки/попередження diff --git a/Sophia/LTSC/Localizations/zh-CN/Sophia.psd1 b/Sophia/LTSC/Localizations/zh-CN/Sophia.psd1 index b3a06ff7..92f67707 100644 --- a/Sophia/LTSC/Localizations/zh-CN/Sophia.psd1 +++ b/Sophia/LTSC/Localizations/zh-CN/Sophia.psd1 @@ -1,7 +1,10 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = 该脚本仅支持Windows 10 x64 UnsupportedOSBuild = 该脚本支持Windows 10版本1809 Enterprise LTSC +UnsupportedLanguageMode = PowerShell会话在有限的语言模式下运行 +LoggedInUserNotAdmin = 登录的用户没有管理员的权利 UnsupportedISE = 该脚本不支持通过Windows PowerShell ISE运行 +Win10TweakerWarning = 可能你的操作系统是通过“Win 10 Tweaker”后门感染的 UnsupportedRelease = 找到新版本 CustomizationWarning = \n在运行Sophia Script之前,您是否已自定义Sophia.ps1预设文件中的每个函数? ControlledFolderAccessDisabled = “受控文件夹访问”已禁用 @@ -27,18 +30,9 @@ CleanupNotificationTaskDescription = 关于清理Windows未使用的文 SoftwareDistributionTaskNotificationEvent = Windows更新缓存已成功删除 TempTaskNotificationEvent = 临时文件文件夹已成功清理 FolderTaskDescription = “{0}”文件夹清理 -ControlledFolderAccess = 受控文件夹访问 -ProtectedFoldersRequest = 是否启用受控文件夹访问权限并指定文件夹,由微软Defender保护其免受恶意应用程序威胁? -ProtectedFoldersListRemoved = 已被移除的文件夹 -AppControlledFolderRequest = 是否指定应用获取受控文件夹访问权限? -AllowedControlledFolderAppsRemoved = 删除了允许的应用 -DefenderExclusionFolderRequest = 是否要添加指定文件夹到微软Defender的恶意软件扫描白名单? -DefenderExclusionFoldersListRemoved = 排除的文件夹已删除 -AddDefenderExclusionFileRequest = 是否要添加指定文件到微软Defender的恶意软件扫描白名单? -DefenderExclusionFilesRemoved = 排除文件已删除 EventViewerCustomViewName = 进程创建 EventViewerCustomViewDescription = 进程创建和命令行审核事件 -RestartWarning = 确保重启电脑 +RestartWarning = \n确保重启电脑 ErrorsLine = 行 ErrorsFile = 文件 ErrorsMessage = 错误/警告 diff --git a/Sophia/LTSC/Manifest/Sophia.psd1 b/Sophia/LTSC/Manifest/Sophia.psd1 index 6aa8305f..96d65646 100644 --- a/Sophia/LTSC/Manifest/Sophia.psd1 +++ b/Sophia/LTSC/Manifest/Sophia.psd1 @@ -1,6 +1,6 @@ @{ RootModule = '..\Module\Sophia.psm1' - ModuleVersion = '5.2.8' + ModuleVersion = '5.2.9' GUID = 'a36a65ca-70f9-43df-856c-3048fc5e7f01' Author = 'Dmitry "farag" Nefedov' Copyright = '(c) 2014–2021 farag & Inestic. All rights reserved' diff --git a/Sophia/LTSC/Module/Sophia.psm1 b/Sophia/LTSC/Module/Sophia.psm1 index 747c24e4..ff785505 100644 --- a/Sophia/LTSC/Module/Sophia.psm1 +++ b/Sophia/LTSC/Module/Sophia.psm1 @@ -2,8 +2,8 @@ .SYNOPSIS "Windows 10 Sophia Script" (LTSC version) is a PowerShell module for Windows 10 fine-tuning and automating the routine tasks - Version: v5.2.8 - Date: 20.06.2021 + Version: v5.2.9 + Date: 12.07.2021 Copyright (c) 2014–2021 farag Copyright (c) 2019–2021 farag & Inestic @@ -37,7 +37,7 @@ .NOTES https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15 - https://habr.com/post/521202/ + https://habr.com/company/skillfactory/blog/553800/ https://forums.mydigitallife.net/threads/powershell-windows-10-sophia-script.81675/ https://www.reddit.com/r/PowerShell/comments/go2n5v/powershell_script_setup_windows_10/ #> @@ -77,19 +77,57 @@ function Checkings } } - # Check whether the script has been run via PowerShell ISE + # Check the language mode + switch ($ExecutionContext.SessionState.LanguageMode -ne "FullLanguage") + { + $true + { + Write-Warning -Message $Localization.UnsupportedLanguageMode + + Start-Process -FilePath "https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_language_modes" + + exit + } + } + + # Check whether the logged-in user is an admin + $CurrentUserName = (Get-Process -Id $PID -IncludeUserName).UserName | Split-Path -Leaf + $CurrentSessionId = (Get-Process -Id $PID -IncludeUserName).SessionId + $LoginUserName = (Get-Process -IncludeUserName -ErrorAction SilentlyContinue | Where-Object -FilterScript {($_.Name -eq "explorer") -and ($_.SessionId -eq $CurrentSessionId)}).UserName | Split-Path -Leaf + + switch ($CurrentUserName -eq $LoginUserName) + { + $false + { + Write-Warning -Message $Localization.LoggedInUserNotAdmin + exit + } + } + + # Check whether the script was run via PowerShell ISE if ($Host.Name -match "ISE") { Write-Warning -Message $Localization.UnsupportedISE exit } + # Check whether the OS was infected by Win 10 Tweaker + if (Test-Path -Path "HKCU:\Software\Win 10 Tweaker") + { + Write-Warning -Message $Localization.Win10TweakerWarning + + Start-Process -FilePath "https://youtu.be/na93MS-1EkM" + Start-Process -FilePath "https://pikabu.ru/story/byekdor_v_win_10_tweaker_ili_sovremennyie_metodyi_borbyi_s_piratstvom_8227558" + + exit + } + # Checking if the current module version is the latest one try { $DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" $Parameters = @{ - Uri = "https://raw.githubusercontent.com/farag2/Windows-10-Sophia-Script/master/Sophia/LTSC/Sophia.psd1" + Uri = "https://raw.githubusercontent.com/farag2/Windows-10-Sophia-Script/master/Sophia/LTSC/Manifest/Sophia.psd1" OutFile = "$DownloadsFolder\Manifest.psd1" Verbose = [switch]::Present } @@ -138,6 +176,11 @@ function Checkings "0" { Invoke-Item -Path $PSScriptRoot\..\Sophia.ps1 + + Start-Sleep -Seconds 5 + + Start-Process -FilePath "https://github.com/farag2/Windows-10-Sophia-Script#how-to-use" + exit } "1" @@ -181,7 +224,7 @@ function Logging function CreateRestorePoint { $SystemDriveUniqueID = (Get-Volume | Where-Object -FilterScript {$_.DriveLetter -eq "$($env:SystemDrive[0])"}).UniqueID - $SystemProtection = ((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SPP\Clients")."{09F7EDC5-294E-4180-AF6A-FB0E6A0E9513}") | Where-Object -FilterScript {$_ -match [regex]::Escape($SystemDriveUniqueID)} + $SystemProtection = ((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SPP\Clients" -ErrorAction Ignore)."{09F7EDC5-294E-4180-AF6A-FB0E6A0E9513}") | Where-Object -FilterScript {$_ -match [regex]::Escape($SystemDriveUniqueID)} $ComputerRestorePoint = $false @@ -197,7 +240,7 @@ function CreateRestorePoint # Never skip creating a restore point New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" -Name SystemRestorePointCreationFrequency -PropertyType DWord -Value 0 -Force - Checkpoint-Computer -Description "Windows 10 Sophia Script" -RestorePointType MODIFY_SETTINGS + Checkpoint-Computer -Description "Sophia Script for Windows 10" -RestorePointType MODIFY_SETTINGS # Revert the System Restore checkpoint creation frequency to 1440 minutes New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" -Name SystemRestorePointCreationFrequency -PropertyType DWord -Value 1440 -Force @@ -213,13 +256,13 @@ function CreateRestorePoint #region Privacy & Telemetry <# .SYNOPSIS - Configure the DiagTrack service, and connection for the Unified Telemetry Client Outbound Traffic + The Connected User Experiences and Telemetry (DiagTrack) service .PARAMETER Disable - Disable the DiagTrack service, and block connection for the Unified Telemetry Client Outbound Traffic + Disable the Connected User Experiences and Telemetry (DiagTrack) service, and block connection for the Unified Telemetry Client Outbound Traffic .PARAMETER Enable - Enable the DiagTrack service, and allow connection for the Unified Telemetry Client Outbound Traffic + Enable the Connected User Experiences and Telemetry (DiagTrack) service, and allow connection for the Unified Telemetry Client Outbound Traffic .EXAMPLE DiagTrackService -Disable @@ -236,49 +279,51 @@ function DiagTrackService ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - Get-Service -Name DiagTrack | Set-Service -StartupType Automatic - Get-Service -Name DiagTrack | Start-Service - - # Allow connection for the Unified Telemetry Client Outbound Traffic - Get-NetFirewallRule -Group DiagTrack | Set-NetFirewallRule -Enabled True -Action Allow - } "Disable" { + # Connected User Experiences and Telemetry Get-Service -Name DiagTrack | Stop-Service -Force Get-Service -Name DiagTrack | Set-Service -StartupType Disabled # Block connection for the Unified Telemetry Client Outbound Traffic Get-NetFirewallRule -Group DiagTrack | Set-NetFirewallRule -Enabled False -Action Block } + "Enable" + { + # Connected User Experiences and Telemetry + Get-Service -Name DiagTrack | Set-Service -StartupType Automatic + Get-Service -Name DiagTrack | Start-Service + + # Allow connection for the Unified Telemetry Client Outbound Traffic + Get-NetFirewallRule -Group DiagTrack | Set-NetFirewallRule -Enabled True -Action Allow + } } } <# .SYNOPSIS - Configure the OS level of diagnostic data gathering + Diagnostic data .PARAMETER Minimal - Set the OS level of diagnostic data gathering to minimum + Set the diagnostic data collection to minimum .PARAMETER Default - Set the OS level of diagnostic data gathering to default + Set the diagnostic data collection to default .EXAMPLE DiagnosticDataLevel -Minimal @@ -331,7 +376,7 @@ function DiagnosticDataLevel <# .SYNOPSIS - Configure the Windows Error Reporting + Windows Error Reporting .PARAMETER Disable Turn off Windows Error Reporting @@ -383,7 +428,7 @@ function ErrorReporting "Enable" { Get-ScheduledTask -TaskName QueueReporting | Enable-ScheduledTask - Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Force -ErrorAction Ignore Get-Service -Name WerSvc | Set-Service -StartupType Manual Get-Service -Name WerSvc | Start-Service @@ -393,45 +438,45 @@ function ErrorReporting <# .SYNOPSIS - Configure the Windows feedback frequency + The feedback frequency - .PARAMETER Disable - Change Windows feedback frequency to "Never" + .PARAMETER Never + Change the feedback frequency to "Never" - .PARAMETER Enable - Change Windows feedback frequency to "Automatically" + .PARAMETER Automatically + Change feedback frequency to "Automatically" .EXAMPLE - WindowsFeedback -Disable + FeedbackFrequency -Never .EXAMPLE - WindowsFeedback -Enable + FeedbackFrequency -Automatically .NOTES Current user #> -function WindowsFeedback +function FeedbackFrequency { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Never" )] [switch] - $Disable, + $Never, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Automatically" )] [switch] - $Enable + $Automatically ) switch ($PSCmdlet.ParameterSetName) { - "Disable" + "Never" { if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Siuf\Rules)) { @@ -439,7 +484,7 @@ function WindowsFeedback } New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Siuf\Rules -Name NumberOfSIUFInPeriod -PropertyType DWord -Value 0 -Force } - "Enable" + "Automatically" { Remove-Item -Path HKCU:\SOFTWARE\Microsoft\Siuf\Rules -Force -ErrorAction SilentlyContinue } @@ -448,7 +493,7 @@ function WindowsFeedback <# .SYNOPSIS - Configure the diagnostics tracking scheduled tasks + The diagnostics tracking scheduled tasks .PARAMETER Disable Turn off the diagnostics tracking scheduled tasks @@ -464,6 +509,8 @@ function WindowsFeedback .NOTES A pop-up dialog box lets a user select tasks + + .NOTES Current user #> function ScheduledTasks @@ -472,17 +519,17 @@ function ScheduledTasks ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) Add-Type -AssemblyName PresentationCore, PresentationFramework @@ -534,7 +581,7 @@ function ScheduledTasks ) # Check if device has a camera - $DeviceHasCamera = Get-CimInstance -ClassName Win32_PnPEntity | Where-Object -FilterScript {($_.PNPClass -eq "Camera") -or ($_.PNPClass -eq "Image")} + $DeviceHasCamera = Get-CimInstance -ClassName Win32_PnPEntity | Where-Object -FilterScript {(($_.PNPClass -eq "Camera") -or ($_.PNPClass -eq "Image")) -and ($_.Service -ne "StillCam")} if (-not $DeviceHasCamera) { # Windows Hello @@ -753,7 +800,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); Add-Type @SetForegroundWindow } - Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -like "Windows 10 Sophia Script*"} | ForEach-Object -Process { + Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -match "Sophia Script"} | ForEach-Object -Process { # Show window, if minimized [WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10) @@ -782,7 +829,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); <# .SYNOPSIS - Configure the sign-in info to automatically finish setting up device and reopen apps after an update or restart + The sign-in info to automatically finish setting up device and reopen apps after an update or restart .PARAMETER Disable Do not use sign-in info to automatically finish setting up device and reopen apps after an update or restart @@ -832,14 +879,14 @@ function SigninInfo "Enable" { $SID = (Get-CimInstance -ClassName Win32_UserAccount | Where-Object -FilterScript {$_.Name -eq $env:USERNAME}).SID - Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\UserARSO\$SID" -Name OptOut -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\UserARSO\$SID" -Name OptOut -Force -ErrorAction Ignore } } } <# .SYNOPSIS - Configure the provision to websites of locally relevant content by accessing language list + The provision to websites a locally relevant content by accessing language list .PARAMETER Disable Do not let websites provide locally relevant content by accessing language list @@ -883,20 +930,20 @@ function LanguageListAccess } "Enable" { - Remove-ItemProperty -Path "HKCU:\Control Panel\International\User Profile" -Name HttpAcceptLanguageOptOut -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKCU:\Control Panel\International\User Profile" -Name HttpAcceptLanguageOptOut -Force -ErrorAction Ignore } } } <# .SYNOPSIS - Configure the permission for apps to use advertising ID + The permission for apps to use advertising ID .PARAMETER Disable - Do not allow apps to use advertising ID + Do not allow apps to use advertising ID to make ads more interresting to you based on your app usage .PARAMETER Enable - Do not allow apps to use advertising ID + Let apps use advertising ID to make ads more interresting to you based on your app usage .EXAMPLE AdvertisingID -Disable @@ -946,63 +993,12 @@ function AdvertisingID } } } - -<# - .SYNOPSIS - Configure the permission for apps on other devices open and message apps on this device, and vice versa - - .PARAMETER Disable - Do not let apps on other devices open and message apps on this device, and vice versa - - .PARAMETER Enable - Let apps on other devices open and message apps on this device, and vice versa - - .EXAMPLE - ShareAcrossDevices -Disable - - .EXAMPLE - ShareAcrossDevices -Enable - - .NOTES - Current user -#> -function ShareAcrossDevices -{ - param - ( - [Parameter( - Mandatory = $true, - ParameterSetName = "Enable" - )] - [switch] - $Enable, - - [Parameter( - Mandatory = $true, - ParameterSetName = "Disable" - )] - [switch] - $Disable - ) - - switch ($PSCmdlet.ParameterSetName) - { - "Enable" - { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CDP -Name RomeSdkChannelUserAuthzPolicy -PropertyType DWord -Value 1 -Force - } - "Disable" - { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CDP -Name RomeSdkChannelUserAuthzPolicy -PropertyType DWord -Value 0 -Force - } - } -} #endregion Privacy & Telemetry #region UI & Personalization <# .SYNOPSIS - Configure the "This PC" icon on Desktop + The "This PC" icon on Desktop .PARAMETER Hide Show the "This PC" icon on Desktop @@ -1050,20 +1046,20 @@ function ThisPC } "Hide" { - Remove-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -Force -ErrorAction Ignore } } } <# .SYNOPSIS - Configure check boxes to select items + Item check boxes .PARAMETER Disable - Do not use check boxes to select items + Do not use item check boxes .PARAMETER Enable - Use check boxes to select items + Use check item check boxes .EXAMPLE CheckBoxes -Disable @@ -1108,7 +1104,7 @@ function CheckBoxes <# .SYNOPSIS - Configure the display of hidden files, folders, and drives + Hidden files, folders, and drives .PARAMETER Enable Show hidden files, folders, and drives @@ -1159,7 +1155,7 @@ function HiddenItems <# .SYNOPSIS - Configure the display of file name extensions + File name extensions .PARAMETER Show Show file name extensions @@ -1210,7 +1206,7 @@ function FileExtensions <# .SYNOPSIS - Configure folder merge conflicts + Folder merge conflicts .PARAMETER Show Show folder merge conflicts @@ -1312,576 +1308,576 @@ function OpenFileExplorerTo <# .SYNOPSIS - Configure Task View button on the taskbar + Windows snapping - .PARAMETER Hide - Show Task View button on the taskbar + .PARAMETER Disable + When I snap a window, do not show what I can snap next to it - .PARAMETER Show - Do not show Task View button on the taskbar + .PARAMETER Enable + When I snap a window, show what I can snap next to it .EXAMPLE - TaskViewButton -Hide + SnapAssist -Disable .EXAMPLE - TaskViewButton -Show + SnapAssist -Enable .NOTES Current user #> -function TaskViewButton +function SnapAssist { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Hide" + ParameterSetName = "Disable" )] [switch] - $Hide, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Show" + ParameterSetName = "Enable" )] [switch] - $Show + $Enable ) switch ($PSCmdlet.ParameterSetName) { - "Hide" + "Disable" { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -PropertyType DWord -Value 0 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name SnapAssist -PropertyType DWord -Value 0 -Force } - "Show" + "Enable" { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -PropertyType DWord -Value 1 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name SnapAssist -PropertyType DWord -Value 1 -Force } } } <# .SYNOPSIS - Configure People button on the taskbar + The file transfer dialog box mode - .PARAMETER Hide - Hide People button on the taskbar + .PARAMETER Detailed + Show the file transfer dialog box in the detailed mode - .PARAMETER Show - Show People button on the taskbar + .PARAMETER Compact + Show the file transfer dialog box in the compact mode .EXAMPLE - PeopleTaskbar -Hide + FileTransferDialog -Detailed .EXAMPLE - PeopleTaskbar -Show + FileTransferDialog -Compact .NOTES Current user #> -function PeopleTaskbar +function FileTransferDialog { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Hide" + ParameterSetName = "Detailed" )] [switch] - $Hide, + $Detailed, [Parameter( Mandatory = $true, - ParameterSetName = "Show" + ParameterSetName = "Compact" )] [switch] - $Show + $Compact ) switch ($PSCmdlet.ParameterSetName) { - "Hide" + "Detailed" { - if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People)) + if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager)) { - New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Force + New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager -Force } - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Name PeopleBand -PropertyType DWord -Value 0 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager -Name EnthusiastMode -PropertyType DWord -Value 1 -Force } - "Show" + "Compact" { - if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People)) + if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager)) { - New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Force + New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager -Force } - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Name PeopleBand -PropertyType DWord -Value 1 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager -Name EnthusiastMode -PropertyType DWord -Value 0 -Force } } } <# .SYNOPSIS - Configure seconds on the taskbar clock + The File Explorer ribbon - .PARAMETER Hide - Hide seconds on the taskbar clock + .PARAMETER Expanded + Expand the File Explorer ribbon - .PARAMETER Show - Show seconds on the taskbar clock + .PARAMETER Minimized + Minimize the File Explorer ribbon .EXAMPLE - SecondsInSystemClock -Hide + FileExplorerRibbon -Expanded .EXAMPLE - SecondsInSystemClock -Show + FileExplorerRibbon -Minimized .NOTES Current user #> -function SecondsInSystemClock +function FileExplorerRibbon { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Hide" + ParameterSetName = "Expanded" )] [switch] - $Hide, + $Expanded, [Parameter( Mandatory = $true, - ParameterSetName = "Show" + ParameterSetName = "Minimized" )] [switch] - $Show + $Minimized ) switch ($PSCmdlet.ParameterSetName) { - "Hide" + "Expanded" { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSecondsInSystemClock -PropertyType DWord -Value 0 -Force + if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon)) + { + New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Force + } + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Name MinimizedStateTabletModeOff -PropertyType DWord -Value 0 -Force } - "Show" + "Minimized" { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSecondsInSystemClock -PropertyType DWord -Value 1 -Force + if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon)) + { + New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Force + } + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Name MinimizedStateTabletModeOff -PropertyType DWord -Value 1 -Force } } } <# .SYNOPSIS - Configure windows snapping - - .PARAMETER Disable - When I snap a window, do not show what I can snap next to it + The recycle bin files delete confirmation dialog .PARAMETER Enable - When I snap a window, show what I can snap next to it + Display the recycle bin files delete confirmation dialog + + .PARAMETER Disable + Do not display the recycle bin files delete confirmation dialog .EXAMPLE - SnapAssist -Disable + RecycleBinDeleteConfirmation -Enable .EXAMPLE - SnapAssist -Enable + RecycleBinDeleteConfirmation -Disable .NOTES Current user #> -function SnapAssist +function RecycleBinDeleteConfirmation { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable + $Disable ) + $ShellState = Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState + switch ($PSCmdlet.ParameterSetName) { - "Disable" + "Enable" { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name SnapAssist -PropertyType DWord -Value 0 -Force + $ShellState[4] = 51 + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState -PropertyType Binary -Value $ShellState -Force } - "Enable" + "Disable" { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name SnapAssist -PropertyType DWord -Value 1 -Force + $ShellState[4] = 55 + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState -PropertyType Binary -Value $ShellState -Force } } } <# .SYNOPSIS - Configure the file transfer dialog box mode - - .PARAMETER Detailed - Show the file transfer dialog box in the detailed mode + The "3D Objects" folder in "This PC" and Quick access - .PARAMETER Compact - Show the file transfer dialog box in the compact mode + .PARAMETER Hide + Hide the "3D Objects" folder in "This PC" and Quick access + + .PARAMETER Show + Show the "3D Objects" folder in "This PC" and Quick access .EXAMPLE - FileTransferDialog -Detailed + 3DObjects -Hide .EXAMPLE - FileTransferDialog -Compact + 3DObjects -Show .NOTES Current user #> -function FileTransferDialog +function 3DObjects { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Detailed" + ParameterSetName = "Hide" )] [switch] - $Detailed, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "Compact" + ParameterSetName = "Show" )] [switch] - $Compact + $Show ) switch ($PSCmdlet.ParameterSetName) { - "Detailed" + "Hide" { - if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager)) + if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag")) { - New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager -Force + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Force } - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager -Name EnthusiastMode -PropertyType DWord -Value 1 -Force + New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force } - "Compact" + "Show" { - if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager)) - { - New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager -Force - } - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager -Name EnthusiastMode -PropertyType DWord -Value 0 -Force + Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction SilentlyContinue + } + } + + # Save all opened folders in order to restore them after File Explorer restart + Clear-Variable -Name OpenedFolders -Force -ErrorAction Ignore + $OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke() + + # In order for the changes to take effect the File Explorer process has to be restarted + Stop-Process -Name explorer -Force + + Start-Sleep -Seconds 3 + + # Restoring closed folders + foreach ($OpenedFolder in $OpenedFolders) + { + if (Test-Path -Path $OpenedFolder) + { + Invoke-Item -Path $OpenedFolder } } } <# .SYNOPSIS - Configure the File Explorer ribbon + Recently used files in Quick access - .PARAMETER Expanded - Expand the File Explorer ribbon + .PARAMETER Hide + Hide recently used files in Quick access - .PARAMETER Minimized - Minimize the File Explorer ribbon + .PARAMETER Show + Show recently used files in Quick access .EXAMPLE - FileExplorerRibbon -Expanded + QuickAccessRecentFiles -Hide .EXAMPLE - FileExplorerRibbon -Minimized + QuickAccessRecentFiles -Show .NOTES Current user #> -function FileExplorerRibbon +function QuickAccessRecentFiles { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Expanded" + ParameterSetName = "Hide" )] [switch] - $Expanded, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "Minimized" + ParameterSetName = "Show" )] [switch] - $Minimized + $Show ) switch ($PSCmdlet.ParameterSetName) { - "Expanded" + "Hide" { - if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon)) - { - New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Force - } - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Name MinimizedStateTabletModeOff -PropertyType DWord -Value 0 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -PropertyType DWord -Value 0 -Force } - "Minimized" + "Show" { - if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon)) - { - New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Force - } - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Name MinimizedStateTabletModeOff -PropertyType DWord -Value 1 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -PropertyType DWord -Value 1 -Force } } } <# .SYNOPSIS - Configure the recycle bin files delete confirmation dialog + Frequently used folders in Quick access - .PARAMETER Disable - Display/do not display the recycle bin files delete confirmation dialog + .PARAMETER Hide + Hide frequently used folders in Quick access - .PARAMETER Enable - Display/do not display the recycle bin files delete confirmation dialog + .PARAMETER Show + Show frequently used folders in Quick access .EXAMPLE - RecycleBinDeleteConfirmation -Disable + QuickAccessFrequentFolders -Hide .EXAMPLE - RecycleBinDeleteConfirmation -Enable + QuickAccessFrequentFolders -Show .NOTES Current user #> -function RecycleBinDeleteConfirmation +function QuickAccessFrequentFolders { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Hide" )] [switch] - $Disable, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Show" )] [switch] - $Enable + $Show ) - $ShellState = Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState - switch ($PSCmdlet.ParameterSetName) { - "Disable" + "Hide" { - $ShellState[4] = 55 - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState -PropertyType Binary -Value $ShellState -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -PropertyType DWord -Value 0 -Force } - "Enable" + "Show" { - $ShellState[4] = 51 - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState -PropertyType Binary -Value $ShellState -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -PropertyType DWord -Value 1 -Force } } } <# .SYNOPSIS - Configure the "3D Objects" folder in "This PC" and Quick access - - .PARAMETER Show - Show the "3D Objects" folder in "This PC" and Quick access + Task view button on the taskbar .PARAMETER Hide - Hide the "3D Objects" folder in "This PC" and Quick access + Hide the Task View button on the taskbar + + .PARAMETER Show + Show the Task View button on the taskbar .EXAMPLE - 3DObjects -Show + TaskViewButton -Hide .EXAMPLE - 3DObjects -Hide + TaskViewButton -Show .NOTES Current user #> -function 3DObjects +function TaskViewButton { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Show" + ParameterSetName = "Hide" )] [switch] - $Show, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "Hide" + ParameterSetName = "Show" )] [switch] - $Hide + $Show ) switch ($PSCmdlet.ParameterSetName) { "Hide" { - if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag")) - { - New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Force - } - New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -PropertyType DWord -Value 0 -Force } "Show" { - Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction SilentlyContinue - } - } - - # Save all opened folders in order to restore them after File Explorer restart - Clear-Variable -Name OpenedFolders -Force -ErrorAction Ignore - $OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke() - - # In order for the changes to take effect the File Explorer process has to be restarted - Stop-Process -Name explorer -Force - - Start-Sleep -Seconds 3 - - # Restoring closed folders - foreach ($OpenedFolder in $OpenedFolders) - { - if (Test-Path -Path $OpenedFolder) - { - Invoke-Item -Path $OpenedFolder + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -PropertyType DWord -Value 1 -Force } } } <# .SYNOPSIS - Configure frequently used folders in Quick access - - .PARAMETER Show - Show frequently used folders in Quick access + People button on the taskbar .PARAMETER Hide - Hide frequently used folders in Quick access + Hide People button on the taskbar + + .PARAMETER Show + Show People button on the taskbar .EXAMPLE - QuickAccessFrequentFolders -Show + PeopleTaskbar -Hide .EXAMPLE - QuickAccessFrequentFolders -Hide + PeopleTaskbar -Show .NOTES Current user #> -function QuickAccessFrequentFolders +function PeopleTaskbar { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Show" + ParameterSetName = "Hide" )] [switch] - $Show, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "Hide" + ParameterSetName = "Show" )] [switch] - $Hide + $Show ) switch ($PSCmdlet.ParameterSetName) { "Hide" { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -PropertyType DWord -Value 0 -Force + if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People)) + { + New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Force + } + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Name PeopleBand -PropertyType DWord -Value 0 -Force } "Show" { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -PropertyType DWord -Value 1 -Force + if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People)) + { + New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Force + } + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Name PeopleBand -PropertyType DWord -Value 1 -Force } } } <# .SYNOPSIS - Configure recently used files in Quick access - - .PARAMETER Show - Show recently used files in Quick access + Seconds on the taskbar clock .PARAMETER Hide - Hide recently used files in Quick access + Hide seconds on the taskbar clock + + .PARAMETER Show + Show seconds on the taskbar clock .EXAMPLE - QuickAccessRecentFiles -Show + SecondsInSystemClock -Hide .EXAMPLE - QuickAccessRecentFiles -Hide + SecondsInSystemClock -Show .NOTES Current user #> -function QuickAccessRecentFiles +function SecondsInSystemClock { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Show" + ParameterSetName = "Hide" )] [switch] - $Show, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "Hide" + ParameterSetName = "Show" )] [switch] - $Hide + $Show ) switch ($PSCmdlet.ParameterSetName) { "Hide" { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -PropertyType DWord -Value 0 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSecondsInSystemClock -PropertyType DWord -Value 0 -Force } "Show" { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -PropertyType DWord -Value 1 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSecondsInSystemClock -PropertyType DWord -Value 1 -Force } } } <# .SYNOPSIS - Configure search on the taskbar + Search on the taskbar - .PARAMETER SearchBox - Show the search box on the taskbar + .PARAMETER Hide + Hide the search on the taskbar .PARAMETER SearchIcon Show the search icon on the taskbar - .PARAMETER Hide - Hide the search on the taskbar + .PARAMETER SearchBox + Show the search box on the taskbar .EXAMPLE TaskbarSearch -SearchBox @@ -1940,7 +1936,7 @@ function TaskbarSearch <# .SYNOPSIS - Configure icons in the notification area + Icons in the notification area .PARAMETER Show Always show all icons in the notification area @@ -1991,16 +1987,16 @@ function TrayIcons <# .SYNOPSIS - Configure the Control Panel icons view + The Control Panel icons view .PARAMETER Category - View the Control Panel icons by: category + View the Control Panel icons by category .PARAMETER LargeIcons - View the Control Panel icons by: large icons + View the Control Panel icons by large icons .PARAMETER SmallIcons - View the Control Panel icons by: Small icons + View the Control Panel icons by Small icons .EXAMPLE ControlPanelView -Category @@ -2074,58 +2070,58 @@ function ControlPanelView <# .SYNOPSIS - Configure the Windows mode color scheme - - .PARAMETER Light - Set the Windows mode color scheme to the light + The default Windows mode .PARAMETER Dark - Set the Windows mode color scheme to the dark + Set the default Windows mode to dark - .EXAMPLE - WindowsColorScheme -Light + .PARAMETER Light + Set the default Windows mode to light .EXAMPLE WindowsColorScheme -Dark + .EXAMPLE + WindowsColorScheme -Light + .NOTES Current user #> -function WindowsColorScheme +function WindowsColorMode { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Light" + ParameterSetName = "Dark" )] [switch] - $Light, + $Dark, [Parameter( Mandatory = $true, - ParameterSetName = "Dark" + ParameterSetName = "Light" )] [switch] - $Dark + $Light ) switch ($PSCmdlet.ParameterSetName) { - "Light" + "Dark" { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -PropertyType DWord -Value 1 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -PropertyType DWord -Value 0 -Force } - "Dark" + "Light" { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -PropertyType DWord -Value 0 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -PropertyType DWord -Value 1 -Force } } } <# .SYNOPSIS - Configure the "New App Installed" indicator + The "New App Installed" indicator .PARAMETER Hide Hide the "New App Installed" indicator @@ -2184,7 +2180,7 @@ function NewAppInstalledNotification <# .SYNOPSIS - Configure first sign-in animation after the upgrade + First sign-in animation after the upgrade .PARAMETER Hide Hide first sign-in animation after the upgrade @@ -2235,7 +2231,7 @@ function FirstLogonAnimation <# .SYNOPSIS - Configure the quality factor of the JPEG desktop wallpapers + The quality factor of the JPEG desktop wallpapers .PARAMETER Max Set the quality factor of the JPEG desktop wallpapers to maximum @@ -2279,14 +2275,14 @@ function JPEGWallpapersQuality } "Default" { - Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name JPEGImportQuality -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name JPEGImportQuality -Force -ErrorAction Ignore } } } <# .SYNOPSIS - Configure the Task Manager mode + The Task Manager mode .PARAMETER Expanded Start Task Manager in the expanded mode @@ -2360,22 +2356,22 @@ function TaskManagerWindow <# .SYNOPSIS - Configure a notification when your PC requires a restart to finish updating - - .PARAMETER Hide - Hide a notification when your PC requires a restart to finish updating + Notification when your PC requires a restart to finish updating .PARAMETER Show Show a notification when your PC requires a restart to finish updating - .EXAMPLE - RestartNotification -Hide + .PARAMETER Hide + Hide a notification when your PC requires a restart to finish updating .EXAMPLE RestartNotification -Show + .EXAMPLE + RestartNotification -Hide + .NOTES - Current user + Machine-wide #> function RestartNotification { @@ -2383,35 +2379,35 @@ function RestartNotification ( [Parameter( Mandatory = $true, - ParameterSetName = "Hide" + ParameterSetName = "Show" )] [switch] - $Hide, + $Show, [Parameter( Mandatory = $true, - ParameterSetName = "Show" + ParameterSetName = "Hide" )] [switch] - $Show + $Hide ) switch ($PSCmdlet.ParameterSetName) { - "Hide" - { - New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name RestartNotificationsAllowed2 -PropertyType DWord -Value 0 -Force - } "Show" { New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name RestartNotificationsAllowed2 -PropertyType DWord -Value 1 -Force } + "Hide" + { + New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name RestartNotificationsAllowed2 -PropertyType DWord -Value 0 -Force + } } } <# .SYNOPSIS - Configure the "- Shortcut" suffix adding to the name of the created shortcuts + The "- Shortcut" suffix adding to the name of the created shortcuts .PARAMETER Disable Do not add the "- Shortcut" suffix to the file name of created shortcuts @@ -2459,27 +2455,27 @@ function ShortcutsSuffix } "Enable" { - Remove-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\NamingTemplates -Name ShortcutNameTemplate -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\NamingTemplates -Name ShortcutNameTemplate -Force -ErrorAction Ignore } } } <# .SYNOPSIS - Configure the PrtScn button usage - - .PARAMETER Disable - Use the PrtScn button to open screen snipping + The Print screen button usage .PARAMETER Enable - Do not use the PrtScn button to open screen snipping + Use the Print screen button to open screen snipping - .EXAMPLE - PrtScnSnippingTool -Disable + .PARAMETER Disable + Do not use the Print screen button to open screen snipping .EXAMPLE PrtScnSnippingTool -Enable + .EXAMPLE + PrtScnSnippingTool -Disable + .NOTES Current user #> @@ -2487,207 +2483,150 @@ function PrtScnSnippingTool { param ( - [Parameter( - Mandatory = $true, - ParameterSetName = "Disable" - )] - [switch] - $Disable, - [Parameter( Mandatory = $true, ParameterSetName = "Enable" )] [switch] - $Enable - ) - - switch ($PSCmdlet.ParameterSetName) - { - "Disable" - { - New-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name PrintScreenKeyForSnippingEnabled -PropertyType DWord -Value 0 -Force - } - "Enable" - { - New-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name PrintScreenKeyForSnippingEnabled -PropertyType DWord -Value 1 -Force - } - } -} - -<# - .SYNOPSIS - Configure an input method for each app window - - .PARAMETER Enable - Let use a different input method for each app window - - .PARAMETER Disable - Do not let use a different input method for each app window - - .EXAMPLE - AppsLanguageSwitch -Disable - - .EXAMPLE - AppsLanguageSwitch -Enable + $Enable, - .NOTES - Current user -#> -function AppsLanguageSwitch -{ - param - ( [Parameter( Mandatory = $true, ParameterSetName = "Disable" )] [switch] - $Disable, - - [Parameter( - Mandatory = $true, - ParameterSetName = "Enable" - )] - [switch] - $Enable + $Disable ) switch ($PSCmdlet.ParameterSetName) { "Enable" { - Set-WinLanguageBarOption -UseLegacySwitchMode + New-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name PrintScreenKeyForSnippingEnabled -PropertyType DWord -Value 1 -Force } "Disable" { - Set-WinLanguageBarOption + New-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name PrintScreenKeyForSnippingEnabled -PropertyType DWord -Value 0 -Force } } } -#endregion UI & Personalization -#region System -#region StorageSense <# .SYNOPSIS - Configure Storage Sense - - .PARAMETER Disable - Turn off Storage Sense + A different input method for each app window .PARAMETER Enable - Turn on off Storage Sense + Let me use a different input method for each app window + + .PARAMETER Disable + Do not use a different input method for each app window .EXAMPLE - StorageSense -Disable + AppsLanguageSwitch -Enable .EXAMPLE - StorageSense -Enable + AppsLanguageSwitch -Disable .NOTES Current user #> -function StorageSense +function AppsLanguageSwitch { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable + $Disable ) switch ($PSCmdlet.ParameterSetName) { - "Disable" + "Enable" { - if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy)) - { - New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -ItemType Directory -Force - } - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01 -PropertyType DWord -Value 0 -Force + Set-WinLanguageBarOption -UseLegacySwitchMode } - "Enable" + "Disable" { - if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy)) - { - New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -ItemType Directory -Force - } - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01 -PropertyType DWord -Value 1 -Force + Set-WinLanguageBarOption } } } +#endregion UI & Personalization +#region System +#region StorageSense <# .SYNOPSIS - Configure Storage Sense running + Storage Sense - .PARAMETER Month - Run Storage Sense every month + .PARAMETER Enable + Turn on Storage Sense - .PARAMETER Default - Run Storage Sense during low free disk space + .PARAMETER Disable + Turn off Storage Sense .EXAMPLE - StorageSenseFrequency -Month + StorageSense -Enable .EXAMPLE - StorageSenseFrequency -Default + StorageSense -Disable .NOTES Current user #> -function StorageSenseFrequency +function StorageSense { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Month" + ParameterSetName = "Enable" )] [switch] - $Month, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Default" + ParameterSetName = "Disable" )] [switch] - $Default + $Disable ) switch ($PSCmdlet.ParameterSetName) { - "Month" + "Enable" { - if ((Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01) -eq "1") + if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy)) { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 2048 -PropertyType DWord -Value 30 -Force + New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -ItemType Directory -Force } + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01 -PropertyType DWord -Value 1 -Force } - "Default" + "Disable" { - if ((Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01) -eq "1") + if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy)) { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 2048 -PropertyType DWord -Value 0 -Force + New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -ItemType Directory -Force } + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01 -PropertyType DWord -Value 0 -Force } } } <# .SYNOPSIS - Configure temporary files deletion + Clean up of temporary files .PARAMETER Enable Delete temporary files that apps aren't using @@ -2744,58 +2683,56 @@ function StorageSenseTempFiles <# .SYNOPSIS - Configure files in recycle bin deletion + Storage Sense running frequency - .PARAMETER Disable - Delete files in recycle bin if they have been there for over 30 days + .PARAMETER Month + Run Storage Sense every month - .PARAMETER Enable - Do not delete files in recycle bin if they have been there for over 30 days + .PARAMETER Default + Run Storage Sense during low free disk space .EXAMPLE - StorageSenseRecycleBin -Enable + StorageSenseFrequency -Month .EXAMPLE - StorageSenseRecycleBin -Disable + StorageSenseFrequency -Default .NOTES Current user #> -function StorageSenseRecycleBin +function StorageSenseFrequency { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Month" )] [switch] - $Enable, + $Month, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Default" )] [switch] - $Disable + $Default ) switch ($PSCmdlet.ParameterSetName) { - "Enable" + "Month" { if ((Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01) -eq "1") { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 08 -PropertyType DWord -Value 1 -Force - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 256 -PropertyType DWord -Value 30 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 2048 -PropertyType DWord -Value 30 -Force } } - "Disable" + "Default" { if ((Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01) -eq "1") { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 08 -PropertyType DWord -Value 0 -Force - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 256 -PropertyType DWord -Value 0 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 2048 -PropertyType DWord -Value 0 -Force } } } @@ -2804,7 +2741,7 @@ function StorageSenseRecycleBin <# .SYNOPSIS - Configure hibernation + Hibernation .PARAMETER Disable Disable hibernation @@ -2820,6 +2757,8 @@ function StorageSenseRecycleBin .NOTES Do not recommend turning it off on laptops + + .NOTES Current user #> function Hibernate @@ -2828,35 +2767,35 @@ function Hibernate ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - POWERCFG /HIBERNATE ON - } "Disable" { POWERCFG /HIBERNATE OFF } + "Enable" + { + POWERCFG /HIBERNATE ON + } } } <# .SYNOPSIS - Configure the %TEMP% environment variable path + The %TEMP% environment variable path .PARAMETER SystemDrive Change the %TEMP% environment variable path to "%SystemDrive%\Temp" @@ -3111,7 +3050,7 @@ Unregister-ScheduledTask -TaskName TemporaryTask -Confirm:`$false <# .SYNOPSIS - Configure the Windows 260 character path limit + The Windows 260 character path limit .PARAMETER Disable Disable the Windows 260 character path limit @@ -3134,17 +3073,17 @@ function Win32LongPathLimit ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) switch ($PSCmdlet.ParameterSetName) @@ -3162,20 +3101,20 @@ function Win32LongPathLimit <# .SYNOPSIS - Configure the Stop error information display on the BSoD - - .PARAMETER Disable - Do not display the Stop error information on the BSoD + The Stop error information display on the BSoD .PARAMETER Enable Display the Stop error information on the BSoD - .EXAMPLE - BSoDStopError -Disable + .PARAMETER Disable + Do not display the Stop error information on the BSoD .EXAMPLE BSoDStopError -Enable + .EXAMPLE + BSoDStopError -Disable + .NOTES Machine-wide #> @@ -3200,32 +3139,32 @@ function BSoDStopError switch ($PSCmdlet.ParameterSetName) { - "Disable" - { - New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl -Name DisplayParameters -PropertyType DWord -Value 0 -Force - } "Enable" { New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl -Name DisplayParameters -PropertyType DWord -Value 1 -Force } + "Disable" + { + New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl -Name DisplayParameters -PropertyType DWord -Value 0 -Force + } } } <# .SYNOPSIS - Confgure UAC + The User Account Control (UAC) behavior - .PARAMETER Disable - Choose when to be notified about changes to your computer: never notify + .PARAMETER Never + Never notify - .PARAMETER Enable - Choose when to be notified about changes to your computer: notify me only when apps try to make changes to my computer + .PARAMETER Default + Notify me only when apps try to make changes to my computer .EXAMPLE - AdminApprovalMode -Disable + AdminApprovalMode -Never .EXAMPLE - AdminApprovalMode -Enable + AdminApprovalMode -Default .NOTES Machine-wide @@ -3236,26 +3175,26 @@ function AdminApprovalMode ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Never" )] [switch] - $Enable, + $Never, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Default" )] [switch] - $Disable + $Default ) switch ($PSCmdlet.ParameterSetName) { - "Disable" + "Never" { New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name ConsentPromptBehaviorAdmin -PropertyType DWord -Value 0 -Force } - "Enable" + "Default" { New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name ConsentPromptBehaviorAdmin -PropertyType DWord -Value 5 -Force } @@ -3264,20 +3203,20 @@ function AdminApprovalMode <# .SYNOPSIS - Configure access to mapped drives from app running with elevated permissions with Admin Approval Mode enabled - - .PARAMETER Disable - Turn off access to mapped drives from app running with elevated permissions with Admin Approval Mode enabled + Access to mapped drives from app running with elevated permissions with Admin Approval Mode enabled .PARAMETER Enable Turn on access to mapped drives from app running with elevated permissions with Admin Approval Mode enabled - .EXAMPLE - MappedDrivesAppElevatedAccess -Disable + .PARAMETER Disable + Turn off access to mapped drives from app running with elevated permissions with Admin Approval Mode enabled .EXAMPLE MappedDrivesAppElevatedAccess -Enable + .EXAMPLE + MappedDrivesAppElevatedAccess -Disable + .NOTES Machine-wide #> @@ -3302,20 +3241,20 @@ function MappedDrivesAppElevatedAccess switch ($PSCmdlet.ParameterSetName) { - "Disable" - { - New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLinkedConnections -PropertyType DWord -Value 0 -Force - } "Enable" { New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLinkedConnections -PropertyType DWord -Value 1 -Force } + "Disable" + { + New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLinkedConnections -PropertyType DWord -Value 0 -Force + } } } <# .SYNOPSIS - Configure Delivery Optimization + Delivery Optimization .PARAMETER Disable Turn off Delivery Optimization @@ -3338,17 +3277,17 @@ function DeliveryOptimization ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) switch ($PSCmdlet.ParameterSetName) @@ -3366,20 +3305,20 @@ function DeliveryOptimization <# .SYNOPSIS - Configure the Group Policy processing - - .PARAMETER Disable - Never wait for the network at computer startup and logon for workgroup networks + The Group Policy processing .PARAMETER Enable Always wait for the network at computer startup and logon for workgroup networks - .EXAMPLE - WaitNetworkStartup -Disable + .PARAMETER Disable + Never wait for the network at computer startup and logon for workgroup networks .EXAMPLE WaitNetworkStartup -Enable + .EXAMPLE + WaitNetworkStartup -Disable + .NOTES Machine-wide #> @@ -3404,13 +3343,6 @@ function WaitNetworkStartup switch ($PSCmdlet.ParameterSetName) { - "Disable" - { - if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $true) - { - Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name SyncForegroundPolicy -Force -ErrorAction SilentlyContinue - } - } "Enable" { if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $true) @@ -3422,18 +3354,25 @@ function WaitNetworkStartup New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name SyncForegroundPolicy -PropertyType DWord -Value 1 -Force } } + "Disable" + { + if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $true) + { + Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name SyncForegroundPolicy -Force -ErrorAction Ignore + } + } } } <# .SYNOPSIS - Configure whether Windows decide which printer should be the default one + Windows manages my default printer .PARAMETER Disable - Do not let Windows decide which printer should be the default one + Do not let Windows manage my default printer .PARAMETER Enable - Let Windows decide which printer should be the default one + Let Windows manage my default printer .EXAMPLE WindowsManageDefaultPrinter -Disable @@ -3450,17 +3389,17 @@ function WindowsManageDefaultPrinter ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) switch ($PSCmdlet.ParameterSetName) @@ -3478,7 +3417,7 @@ function WindowsManageDefaultPrinter <# .SYNOPSIS - Configure Windows features + Windows features .PARAMETER Disable Disable Windows features @@ -3494,6 +3433,8 @@ function WindowsManageDefaultPrinter .NOTES A pop-up dialog box lets a user select features + + .NOTES Current user #> function WindowsFeatures @@ -3502,17 +3443,17 @@ function WindowsFeatures ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) Add-Type -AssemblyName PresentationCore, PresentationFramework @@ -3542,13 +3483,8 @@ function WindowsFeatures # The following Windows features will have their checkboxes unchecked [string[]]$UncheckedFeatures = @( - <# - Media Features - If you want to leave "Multimedia settings" in the advanced settings of Power Options do not disable this feature - - Компоненты работы с мультимедиа - Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах электропитания, не отключайте этот компонент - #> + # Media Features + # If you want to leave "Multimedia settings" in the advanced settings of Power Options do not disable this feature "MediaPlayback" ) #endregion Variables @@ -3801,7 +3737,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); <# .SYNOPSIS - Configure optional features + Optional features .PARAMETER Uninstall Uninstall optional features @@ -3817,6 +3753,8 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); .NOTES A pop-up dialog box lets a user select features + + .NOTES Current user #> function WindowsCapabilities @@ -3825,17 +3763,17 @@ function WindowsCapabilities ( [Parameter( Mandatory = $true, - ParameterSetName = "Install" + ParameterSetName = "Uninstall" )] [switch] - $Install, + $Uninstall, [Parameter( Mandatory = $true, - ParameterSetName = "Uninstall" + ParameterSetName = "Install" )] [switch] - $Uninstall + $Install ) Add-Type -AssemblyName PresentationCore, PresentationFramework @@ -3860,13 +3798,8 @@ function WindowsCapabilities # Распознаватель математических знаков "MathRecognizer*", - <# - Windows Media Player - Проигрыватель Windows Media - - If you want to leave "Multimedia settings" element in the advanced settings of Power Options do not uninstall this feature - Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах электропитания, не удаляйте этот компонент - #> + # Windows Media Player + # If you want to leave "Multimedia settings" element in the advanced settings of Power Options do not uninstall this feature "Media.WindowsMediaPlayer*", # OpenSSH Client @@ -4170,20 +4103,20 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); <# .SYNOPSIS - Configure receiving updates for other Microsoft products when you update Windows - - .PARAMETER Disable - Do not receive updates for other Microsoft products when you update Windows + Receive updates for other Microsoft products when you update Windows .PARAMETER Enable Receive updates for other Microsoft products when you update Windows - .EXAMPLE - UpdateMicrosoftProducts -Disable + .PARAMETER Disable + Do not receive updates for other Microsoft products when you update Windows .EXAMPLE UpdateMicrosoftProducts -Enable + .EXAMPLE + UpdateMicrosoftProducts -Disable + .NOTES Current user #> @@ -4208,6 +4141,10 @@ function UpdateMicrosoftProducts switch ($PSCmdlet.ParameterSetName) { + "Enable" + { + (New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "") + } "Disable" { if ((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"}) @@ -4215,22 +4152,18 @@ function UpdateMicrosoftProducts (New-Object -ComObject Microsoft.Update.ServiceManager).RemoveService("7971f918-a847-4430-9279-4a52d1efe18d") } } - "Enable" - { - (New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "") - } } } <# .SYNOPSIS - Configure a power plan + Power plan .PARAMETER High - Set the power plan on "High performance" + Set power plan on "High performance" .PARAMETER Balanced - Set the power plan on "Balanced" + Set power plan on "Balanced" .EXAMPLE PowerPlan -High @@ -4240,6 +4173,8 @@ function UpdateMicrosoftProducts .NOTES It isn't recommended to turn on the "High performance" power plan on laptops + + .NOTES Current user #> function PowerPlan @@ -4276,20 +4211,20 @@ function PowerPlan <# .SYNOPSIS - Configure the latest installed .NET runtime for all apps usage - - .PARAMETER Disable - Do not use latest installed .NET runtime for all apps + The the latest installed .NET runtime for all apps usage .PARAMETER Enable - Use use latest installed .NET runtime for all apps + Use the latest installed .NET runtime for all apps - .EXAMPLE - LatestInstalled.NET -Disable + .PARAMETER Disable + Do not use the latest installed .NET runtime for all apps .EXAMPLE LatestInstalled.NET -Enable + .EXAMPLE + LatestInstalled.NET -Disable + .NOTES Machine-wide #> @@ -4299,37 +4234,37 @@ function LatestInstalled.NET ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable + $Disable ) switch ($PSCmdlet.ParameterSetName) { - "Disable" - { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction SilentlyContinue - Remove-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction SilentlyContinue - } "Enable" { New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force } + "Disable" + { + Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore + Remove-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore + } } } <# .SYNOPSIS - Configure network adapters to save power + Network adapters power management .PARAMETER Disable Do not allow the computer to turn off the network adapters to save power @@ -4338,10 +4273,10 @@ function LatestInstalled.NET Allow the computer to turn off the network adapters to save power .EXAMPLE - PCTurnOffDevice -Disable + NetworkAdaptersSavePower -Disable .EXAMPLE - PCTurnOffDevice -Enable + NetworkAdaptersSavePower -Enable .NOTES Do not recommend turning it on on laptops @@ -4349,7 +4284,7 @@ function LatestInstalled.NET .NOTES Current user #> -function PCTurnOffDevice +function NetworkAdaptersSavePower { param ( @@ -4393,24 +4328,24 @@ function PCTurnOffDevice <# .SYNOPSIS - Configure override for default input method + Override for default input method .PARAMETER English Override for default input method: English .PARAMETER Default - Override for default input method: use langiage list + Override for default input method: use language list .EXAMPLE - SetInputMethod -English + InputMethod -English .EXAMPLE - SetInputMethod -Default + InputMethod -Default .NOTES Current user #> -function SetInputMethod +function InputMethod { param ( @@ -4437,14 +4372,14 @@ function SetInputMethod } "Default" { - Remove-ItemProperty -Path "HKCU:\Control Panel\International\User Profile" -Name InputMethodOverride -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKCU:\Control Panel\International\User Profile" -Name InputMethodOverride -Force -ErrorAction Ignore } } } <# .SYNOPSIS - Configure user folders location + User folders location .PARAMETER Root Move user folders location to the root of any drive using the interactive menu @@ -4466,6 +4401,8 @@ function SetInputMethod .NOTES User files or folders won't me moved to a new location + + .NOTES Current user #> function SetUserShellFolderLocation @@ -4636,12 +4573,12 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int } # Determining the current user folder path - $UserShellFolderRegistryValue = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name $UserShellFoldersRegistryNames[$UserFolder] - if ($UserShellFolderRegistryValue -ne $FolderPath) + $CurrentUserFolderPath = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name $UserShellFoldersRegistryNames[$UserFolder] + if ($CurrentUserFolder -ne $FolderPath) { - if ((Get-ChildItem -Path $UserShellFolderRegistryValue | Measure-Object).Count -ne 0) + if ((Get-ChildItem -Path $CurrentUserFolderPath | Measure-Object).Count -ne 0) { - Write-Error -Message ($Localization.UserShellFolderNotEmpty -f $UserShellFolderRegistryValue) -ErrorAction SilentlyContinue + Write-Error -Message ($Localization.UserShellFolderNotEmpty -f $CurrentUserFolderPath) -ErrorAction SilentlyContinue } # Creating a new folder if there is no one @@ -4653,7 +4590,7 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int # Removing old desktop.ini if ($RemoveDesktopINI.IsPresent) { - Remove-Item -Path "$UserShellFolderRegistryValue\desktop.ini" -Force + Remove-Item -Path "$CurrentUserFolderPath\desktop.ini" -Force } KnownFolderPath -KnownFolder $UserFolder -Path $FolderPath @@ -4950,7 +4887,7 @@ public static string GetString(uint strId) $Title = "" $Message = $Localization.UserFolderSelect -f $DesktopLocalizedString - $Select = $Localization.Browse + $Browse = $Localization.Browse $Skip = $Localization.Skip $Options = "&$Browse", "&$Skip" $DefaultChoice = 1 @@ -4986,7 +4923,7 @@ public static string GetString(uint strId) $Title = "" $Message = $Localization.UserFolderSelect -f $DocumentsLocalizedString - $Select = $Localization.Browse + $Browse = $Localization.Browse $Skip = $Localization.Skip $Options = "&$Browse", "&$Skip" $DefaultChoice = 1 @@ -5022,7 +4959,7 @@ public static string GetString(uint strId) $Title = "" $Message = $Localization.UserFolderSelect -f $DownloadsLocalizedString - $Select = $Localization.Browse + $Browse = $Localization.Browse $Skip = $Localization.Skip $Options = "&$Browse", "&$Skip" $DefaultChoice = 1 @@ -5058,7 +4995,7 @@ public static string GetString(uint strId) $Title = "" $Message = $Localization.UserFolderSelect -f $MusicLocalizedString - $Select = $Localization.Browse + $Browse = $Localization.Browse $Skip = $Localization.Skip $Options = "&$Browse", "&$Skip" $DefaultChoice = 1 @@ -5094,7 +5031,7 @@ public static string GetString(uint strId) $Title = "" $Message = $Localization.UserFolderSelect -f $PicturesLocalizedString - $Select = $Localization.Browse + $Browse = $Localization.Browse $Skip = $Localization.Skip $Options = "&$Browse", "&$Skip" $DefaultChoice = 1 @@ -5130,7 +5067,7 @@ public static string GetString(uint strId) $Title = "" $Message = $Localization.UserFolderSelect -f $VideosLocalizedString - $Select = $Localization.Browse + $Browse = $Localization.Browse $Skip = $Localization.Skip $Options = "&$Browse", "&$Skip" $DefaultChoice = 1 @@ -5306,7 +5243,7 @@ public static string GetString(uint strId) <# .SYNOPSIS - Choose where to save screenshots by pressing Win+PrtScr + The location to save screenshots by pressing Win+PrtScr .PARAMETER Desktop Save screenshots by pressing Win+PrtScr on the Desktop @@ -5351,7 +5288,7 @@ function WinPrtScrFolder } "Default" { - Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{B7BEDE81-DF94-4682-A7D8-57A52620B86F}" -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{B7BEDE81-DF94-4682-A7D8-57A52620B86F}" -Force -ErrorAction Ignore } } @@ -5376,10 +5313,10 @@ function WinPrtScrFolder <# .SYNOPSIS - Configure folder windows launching in a separate process + Folder windows launching in a separate process .PARAMETER Enable - Launch launch folder windows in a separate process + Launch folder windows in a separate process .PARAMETER Disable Do not launch folder windows in a separate process @@ -5427,20 +5364,20 @@ function FoldersLaunchSeparateProcess <# .SYNOPSIS - Configure help look up via F1 - - .PARAMETER Enable - Enable help lookup via F1 + Help look up via F1 .PARAMETER Disable Disable help lookup via F1 - .EXAMPLE - F1HelpPage -Enable + .PARAMETER Enable + Enable help lookup via F1 .EXAMPLE F1HelpPage -Disable + .EXAMPLE + F1HelpPage -Enable + .NOTES Current user #> @@ -5450,25 +5387,21 @@ function F1HelpPage ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - Remove-Item -Path "HKCU:\SOFTWARE\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee}" -Recurse -Force -ErrorAction SilentlyContinue - } "Disable" { if (-not (Test-Path -Path "HKCU:\SOFTWARE\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee}\1.0\0\win64")) @@ -5477,12 +5410,16 @@ function F1HelpPage } New-ItemProperty -Path "HKCU:\SOFTWARE\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee}\1.0\0\win64" -Name "(default)" -PropertyType String -Value "" -Force } + "Enable" + { + Remove-Item -Path "HKCU:\SOFTWARE\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee}" -Recurse -Force -ErrorAction SilentlyContinue + } } } <# .SYNOPSIS - Configure Num Lock at startup + Num Lock at startup .PARAMETER Enable Enable Num Lock at startup @@ -5533,20 +5470,20 @@ function NumLock <# .SYNOPSIS - Configure Caps Lock - - .PARAMETER Enable - Enable Capsm Lock + Caps Lock .PARAMETER Disable Disable Caps Lock - .EXAMPLE - CapsLock -Enable + .PARAMETER Enable + Enable Caps Lock .EXAMPLE CapsLock -Disable + .EXAMPLE + CapsLock -Enable + .NOTES Machine-wide #> @@ -5556,48 +5493,48 @@ function CapsLock ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout" -Name "Scancode Map" -Force - } "Disable" { New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout" -Name "Scancode Map" -PropertyType Binary -Value ([byte[]](0,0,0,0,0,0,0,0,2,0,0,0,0,0,58,0,0,0,0,0)) -Force } + "Enable" + { + Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout" -Name "Scancode Map" -Force + } } } <# .SYNOPSIS - Configure Sticky Keys - - .PARAMETER Enable - Enable Sticky Keys after tapping the Shift key 5 times + The keyboard schortcut for Stick keys .PARAMETER Disable - Disable Sticky Keys after tapping the Shift key 5 times + Turn off pressing the Shift key 5 times to turn Sticky keys - .EXAMPLE - StickyShift -Enable + .PARAMETER Enable + Turn on pressing the Shift key 5 times to turn Sticky keys .EXAMPLE StickyShift -Disable + .EXAMPLE + StickyShift -Enable + .NOTES Current user #> @@ -5607,48 +5544,48 @@ function StickyShift ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - New-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name Flags -PropertyType String -Value 510 -Force - } "Disable" { New-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name Flags -PropertyType String -Value 506 -Force } + "Enable" + { + New-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name Flags -PropertyType String -Value 510 -Force + } } } <# .SYNOPSIS - Configure AutoPlay for all media and devices - - .PARAMETER Enable - Disable/enable AutoPlay for all media and devices + AutoPlay for all media and devices .PARAMETER Disable - Disable/enable AutoPlay for all media and devices + Don't use AutoPlay for all media and devices - .EXAMPLE - Autoplay -Enable + .PARAMETER Enable + Use AutoPlay for all media and devices .EXAMPLE Autoplay -Disable + .EXAMPLE + Autoplay -Enable + .NOTES Current user #> @@ -5658,48 +5595,48 @@ function Autoplay ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers -Name DisableAutoplay -PropertyType DWord -Value 0 -Force - } "Disable" { New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers -Name DisableAutoplay -PropertyType DWord -Value 1 -Force } + "Enable" + { + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers -Name DisableAutoplay -PropertyType DWord -Value 0 -Force + } } } <# .SYNOPSIS - Configure thumbnail cache removal - - .PARAMETER Enable - Enable thumbnail cache removal + Thumbnail cache removal .PARAMETER Disable Disable thumbnail cache removal - .EXAMPLE - ThumbnailCacheRemoval -Enable + .PARAMETER Enable + Enable thumbnail cache removal .EXAMPLE ThumbnailCacheRemoval -Disable + .EXAMPLE + ThumbnailCacheRemoval -Enable + .NOTES Machine-wide #> @@ -5709,35 +5646,36 @@ function ThumbnailCacheRemoval ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Thumbnail Cache" -Name Autorun -PropertyType DWord -Value 3 -Force - } "Disable" { New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Thumbnail Cache" -Name Autorun -PropertyType DWord -Value 0 -Force } + "Enable" + { + New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Thumbnail Cache" -Name Autorun -PropertyType DWord -Value 3 -Force + } } } + <# .SYNOPSIS - Configure "Network Discovery" and "File and Printers Sharing" for workgroup networks + Network Discovery File and Printers Sharing .PARAMETER Enable Enable "Network Discovery" and "File and Printers Sharing" for workgroup networks @@ -5807,66 +5745,67 @@ function NetworkDiscovery <# .SYNOPSIS - Configure automatically adjusting active hours for me based on daily usage + Active hours - .PARAMETER Enable - Enable automatically adjusting active hours for me based on daily usage + .PARAMETER Automatically + Automatically adjust active hours for me based on daily usage - .PARAMETER Disable - Disable automatically adjusting active hours for me based on daily usage + .PARAMETER Manual + Manually adjust active hours for me based on daily usage .EXAMPLE - SmartActiveHours -Enable + ActiveHours -Automatically .EXAMPLE - SmartActiveHours -Disable + ActiveHours -Manual .NOTES Machine-wide #> -function SmartActiveHours +function ActiveHours { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Automatically" )] [switch] - $Enable, + $Automatically, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Manual" )] [switch] - $Disable + $Manual ) switch ($PSCmdlet.ParameterSetName) { - "Enable" + "Automatically" { New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name SmartActiveHoursState -PropertyType DWord -Value 1 -Force } - "Disable" + "Manual" { - New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name SmartActiveHoursState -PropertyType DWord -Value 2 -Force + New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name SmartActiveHoursState -PropertyType DWord -Value 0 -Force } } } + <# .SYNOPSIS - Register app, calculate hash, and set as default for specific extension without the "How do you want to open this" pop-up + Register app, calculate hash, and associate with an extension with the "How do you want to open this" pop-up hidden .PARAMETER ProgramPath - Set path to the program to be associate with + Set a path to a program to associate an extension with .PARAMETER Extension Set the extension type .PARAMETER Icon - Set the path to the icon + Set a path to an icon .EXAMPLE Set-Association -ProgramPath "C:\SumatraPDF.exe" -Extension .pdf -Icon "shell32.dll,100" @@ -6220,9 +6159,19 @@ namespace RegistryUtils foreach ($AppxProgID in ($OpenSubkey | Where-Object -FilterScript {$_ -match "AppX"})) { # If an app is installed - if ((Get-ItemProperty -Path "HKCU:\SOFTWARE\Classes\$AppxProgID\Shell\open" -Name PackageId).PackageId) + if (Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Classes\$AppxProgID\Shell\open" -Name PackageId) { - New-ItemProperty -Path "HKCU:\SOFTWARE\Classes\$AppxProgID" -Name NoOpenWith -PropertyType String -Value "" -Force + # If the specified ProgId is equal to UWP installed ProgId + if ($ProgId -eq $AppxProgID) + { + # Remove association limitations for this UWP apps + Remove-ItemProperty -Path "HKCU:\SOFTWARE\Classes\$AppxProgID" -Name NoOpenWith -Force -ErrorAction Ignore + Remove-ItemProperty -Path "HKCU:\SOFTWARE\Classes\$AppxProgID" -Name NoStaticDefaultVerb -Force -ErrorAction Ignore + } + else + { + New-ItemProperty -Path "HKCU:\SOFTWARE\Classes\$AppxProgID" -Name NoOpenWith -PropertyType String -Value "" -Force + } } } } @@ -6498,7 +6447,7 @@ public static void Refresh() #region Start menu <# .SYNOPSIS - Configure recently added apps in the Start menu + Recently added apps in the Start menu .PARAMETER Hide Hide recently added apps in the Start menu @@ -6521,271 +6470,160 @@ function RecentlyAddedApps ( [Parameter( Mandatory = $true, - ParameterSetName = "Hide" - )] - [switch] - $Hide, - - [Parameter( - Mandatory = $true, - ParameterSetName = "Show" - )] - [switch] - $Show - ) - - switch ($PSCmdlet.ParameterSetName) - { - "Hide" - { - if (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer)) - { - New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Force - } - New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -PropertyType DWord -Value 1 -Force - } - "Show" - { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Force -ErrorAction SilentlyContinue - } - } -} - -<# - .SYNOPSIS - Configure app suggestions in the Start menu - - .PARAMETER Hide - Hide app suggestions in the Start menu - - .PARAMETER Show - Show app suggestions in the Start menu - - .EXAMPLE - AppSuggestions -Hide - - .EXAMPLE - AppSuggestions -Show - - .NOTES - Current user -#> -function AppSuggestions -{ - param - ( - [Parameter( - Mandatory = $true, - ParameterSetName = "Hide" - )] - [switch] - $Hide, - - [Parameter( - Mandatory = $true, - ParameterSetName = "Show" - )] - [switch] - $Show - ) - - switch ($PSCmdlet.ParameterSetName) - { - "Hide" - { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338388Enabled -PropertyType DWord -Value 0 -Force - } - "Show" - { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338388Enabled -PropertyType DWord -Value 1 -Force - } - } -} - -<# - .SYNOPSIS - Configure how to run the Windows PowerShell shortcut - - .PARAMETER Elevated - Run the Windows PowerShell shortcut from the Start menu as Administrator - - .PARAMETER NonElevated - Run the Windows PowerShell shortcut from the Start menu as user - - .EXAMPLE - RunPowerShellShortcut -Elevated - - .EXAMPLE - RunPowerShellShortcut -NonElevated - - .NOTES - Current user -#> -function RunPowerShellShortcut -{ - param - ( - [Parameter( - Mandatory = $true, - ParameterSetName = "Elevated" + ParameterSetName = "Hide" )] [switch] - $Elevated, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "NonElevated" + ParameterSetName = "Show" )] [switch] - $NonElevated + $Show ) switch ($PSCmdlet.ParameterSetName) { - "Elevated" + "Hide" { - [byte[]]$bytes = Get-Content -Path "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell.lnk" -Encoding Byte -Raw - $bytes[0x15] = $bytes[0x15] -bor 0x20 - Set-Content -Path "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell.lnk" -Value $bytes -Encoding Byte -Force + if (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer)) + { + New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Force + } + New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -PropertyType DWord -Value 1 -Force } - "NonElevated" + "Show" { - [byte[]]$bytes = Get-Content -Path "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell.lnk" -Encoding Byte -Raw - $bytes[0x15] = $bytes[0x15] -bxor 0x20 - Set-Content -Path "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell.lnk" -Value $bytes -Encoding Byte -Force + Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Force -ErrorAction Ignore } } } -#endregion Start menu -#region Gaming <# .SYNOPSIS - Configure Xbox Game Bar + App suggestions in the Start menu - .PARAMETER Disable - Disable Xbox Game Bar + .PARAMETER Hide + Hide app suggestions in the Start menu - .PARAMETER Enable - Enable Xbox Game Bar + .PARAMETER Show + Show app suggestions in the Start menu .EXAMPLE - XboxGameBar -Disable + AppSuggestions -Hide .EXAMPLE - XboxGameBar -Enable + AppSuggestions -Show .NOTES Current user #> -function XboxGameBar +function AppSuggestions { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Hide" )] [switch] - $Disable, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Show" )] [switch] - $Enable + $Show ) switch ($PSCmdlet.ParameterSetName) { - "Disable" + "Hide" { - if ((Get-AppxPackage -Name Microsoft.XboxGamingOverlay) -or (Get-AppxPackage -Name Microsoft.GamingApp)) - { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 0 -Force - New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 0 -Force - } + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338388Enabled -PropertyType DWord -Value 0 -Force } - "Enable" + "Show" { - if ((Get-AppxPackage -Name Microsoft.XboxGamingOverlay) -or (Get-AppxPackage -Name Microsoft.GamingApp)) - { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 1 -Force - New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 1 -Force - } + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338388Enabled -PropertyType DWord -Value 1 -Force } } } <# .SYNOPSIS - Configure Xbox Game Bar tips + How to run the Windows PowerShell shortcut - .PARAMETER Disable - Disable Xbox Game Bar tips + .PARAMETER Elevated + Run the Windows PowerShell shortcut from the Start menu as Administrator - .PARAMETER Enable - Enable Xbox Game Bar tips + .PARAMETER NonElevated + Run the Windows PowerShell shortcut from the Start menu as user .EXAMPLE - XboxGameTips -Disable + RunPowerShellShortcut -Elevated .EXAMPLE - XboxGameTips -Enable + RunPowerShellShortcut -NonElevated .NOTES Current user #> -function XboxGameTips +function RunPowerShellShortcut { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Elevated" )] [switch] - $Disable, + $Elevated, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "NonElevated" )] [switch] - $Enable + $NonElevated ) switch ($PSCmdlet.ParameterSetName) { - "Disable" + "Elevated" { - if ((Get-AppxPackage -Name Microsoft.XboxGamingOverlay) -or (Get-AppxPackage -Name Microsoft.GamingApp)) - { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\GameBar -Name ShowStartupPanel -PropertyType DWord -Value 0 -Force - } + [byte[]]$bytes = Get-Content -Path "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell.lnk" -Encoding Byte -Raw + $bytes[0x15] = $bytes[0x15] -bor 0x20 + Set-Content -Path "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell.lnk" -Value $bytes -Encoding Byte -Force } - "Enable" + "NonElevated" { - if ((Get-AppxPackage -Name Microsoft.XboxGamingOverlay) -or (Get-AppxPackage -Name Microsoft.GamingApp)) - { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\GameBar -Name ShowStartupPanel -PropertyType DWord -Value 1 -Force - } + [byte[]]$bytes = Get-Content -Path "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell.lnk" -Encoding Byte -Raw + $bytes[0x15] = $bytes[0x15] -bxor 0x20 + Set-Content -Path "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell.lnk" -Value $bytes -Encoding Byte -Force } } } +#endregion Start menu +#region Gaming <# .SYNOPSIS - Choose an app to set "High performance" graphics preference + Choose an app and set the "High performance" graphics performance for it + + .EXAMPLE + SetAppGraphicsPerformance + + .NOTES + Works only with a dedicated GPU .NOTES - Only with a dedicated GPU Current user #> function SetAppGraphicsPerformance { - if (Get-CimInstance -ClassName Win32_VideoController | Where-Object -FilterScript {$_.AdapterDACType -ne "Internal" -and $null -ne $_.AdapterDACType}) + if (Get-CimInstance -ClassName Win32_VideoController | Where-Object -FilterScript {($_.AdapterDACType -ne "Internal") -and ($null -ne $_.AdapterDACType)}) { $Title = $Localization.GraphicsPerformanceTitle $Message = $Localization.GraphicsPerformanceRequest @@ -6852,6 +6690,8 @@ function SetAppGraphicsPerformance .NOTES A native interactive toast notification pops up every 30 days The task runs every 30 days + + .NOTES Current user #> function CleanupTask @@ -7112,6 +6952,8 @@ while (`$true) .NOTES The task will wait until the Windows Updates service finishes running The task runs every 90 days + + .NOTES Current user #> function SoftwareDistributionTask @@ -7215,6 +7057,8 @@ Get-ChildItem -Path `$env:SystemRoot\SoftwareDistribution\Download -Recurse -For .NOTES The task runs every 60 days + + .NOTES Current user #> function TempTask @@ -7294,234 +7138,23 @@ Get-ChildItem -Path `$env:TEMP -Recurse -Force | Where-Object {`$_.CreationTime #endregion Scheduled tasks #region Windows Defender & Security -# Enable Controlled folder access and add protected folders -function AddProtectedFolders -{ - $Title = $Localization.ControlledFolderAccess - $Message = $Localization.ProtectedFoldersRequest - $Add = $Localization.Add - $Skip = $Localization.Skip - $Options = "&$Add", "&$Skip" - $DefaultChoice = 1 - - do - { - $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) - switch ($Result) - { - "0" - { - Add-Type -AssemblyName System.Windows.Forms - $FolderBrowserDialog = New-Object -TypeName System.Windows.Forms.FolderBrowserDialog - $FolderBrowserDialog.Description = $Localization.FolderSelect - $FolderBrowserDialog.RootFolder = "MyComputer" - - # Force move the open file dialog to the foreground - $Focus = New-Object -TypeName System.Windows.Forms.Form -Property @{TopMost = $true} - $FolderBrowserDialog.ShowDialog($Focus) - - if ($FolderBrowserDialog.SelectedPath) - { - Set-MpPreference -EnableControlledFolderAccess Enabled - Add-MpPreference -ControlledFolderAccessProtectedFolders $FolderBrowserDialog.SelectedPath -Force - Write-Verbose -Message ("{0}" -f $FolderBrowserDialog.SelectedPath) -Verbose - } - } - "1" - { - Write-Verbose -Message $Localization.Skipped -Verbose - } - } - } - until ($Result -eq 1) -} - -# Remove all added protected folders -function RemoveProtectedFolders -{ - if ($null -ne (Get-MpPreference).ControlledFolderAccessProtectedFolders) - { - (Get-MpPreference).ControlledFolderAccessProtectedFolders | Format-Table -AutoSize -Wrap - Remove-MpPreference -ControlledFolderAccessProtectedFolders (Get-MpPreference).ControlledFolderAccessProtectedFolders -Force - Write-Verbose -Message $Localization.ProtectedFoldersListRemoved -Verbose - } -} - -# Allow an app through Controlled folder access -function AddAppControlledFolder -{ - $Title = $Localization.ControlledFolderAccess - $Message = $Localization.AppControlledFolderRequest - $Add = $Localization.Add - $Skip = $Localization.Skip - $Options = "&$Add", "&$Skip" - $DefaultChoice = 1 - - do - { - $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) - switch ($Result) - { - "0" - { - Add-Type -AssemblyName System.Windows.Forms - $OpenFileDialog = New-Object -TypeName System.Windows.Forms.OpenFileDialog - $OpenFileDialog.Filter = $Localization.EXEFilesFilter - $OpenFileDialog.InitialDirectory = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" - $OpenFileDialog.Multiselect = $false - - # Force move the open file dialog to the foreground - $Focus = New-Object -TypeName System.Windows.Forms.Form -Property @{TopMost = $true} - $OpenFileDialog.ShowDialog($Focus) - - if ($OpenFileDialog.FileName) - { - Add-MpPreference -ControlledFolderAccessAllowedApplications $OpenFileDialog.FileName -Force - Write-Verbose -Message ("{0}" -f $OpenFileDialog.FileName) -Verbose - } - } - "1" - { - Write-Verbose -Message $Localization.Skipped -Verbose - } - } - } - until ($Result -eq 1) -} - -# Remove all allowed apps through Controlled folder access -function RemoveAllowedAppsControlledFolder -{ - if ($null -ne (Get-MpPreference).ControlledFolderAccessAllowedApplications) - { - (Get-MpPreference).ControlledFolderAccessAllowedApplications | Format-Table -AutoSize -Wrap - Remove-MpPreference -ControlledFolderAccessAllowedApplications (Get-MpPreference).ControlledFolderAccessAllowedApplications -Force - Write-Verbose -Message $Localization.AllowedControlledFolderAppsRemoved -Verbose - } -} - -# Add a folder to the exclusion from Windows Defender scanning -function AddDefenderExclusionFolder -{ - $Title = "Windows Defender" - $Message = $Localization.DefenderExclusionFolderRequest - $Add = $Localization.Add - $Skip = $Localization.Skip - $Options = "&$Add", "&$Skip" - $DefaultChoice = 1 - - do - { - $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) - switch ($Result) - { - "0" - { - Add-Type -AssemblyName System.Windows.Forms - $FolderBrowserDialog = New-Object -TypeName System.Windows.Forms.FolderBrowserDialog - $FolderBrowserDialog.Description = $Localization.FolderSelect - $FolderBrowserDialog.RootFolder = "MyComputer" - - # Force move the open file dialog to the foreground - $Focus = New-Object -TypeName System.Windows.Forms.Form -Property @{TopMost = $true} - $FolderBrowserDialog.ShowDialog($Focus) - - if ($FolderBrowserDialog.SelectedPath) - { - Add-MpPreference -ExclusionPath $FolderBrowserDialog.SelectedPath -Force - Write-Verbose -Message ("{0}" -f $FolderBrowserDialog.SelectedPath) -Verbose - } - } - "1" - { - Write-Verbose -Message $Localization.Skipped -Verbose - } - } - } - until ($Result -eq 1) -} - -# Remove all excluded folders from Windows Defender scanning -function RemoveDefenderExclusionFolders -{ - if ($null -ne (Get-MpPreference).ExclusionPath) - { - $ExcludedFolders = (Get-Item -Path (Get-MpPreference).ExclusionPath -Force -ErrorAction Ignore | Where-Object -FilterScript {$_.Attributes -match "Directory"}).FullName - $ExcludedFolders | Format-Table -AutoSize -Wrap - Remove-MpPreference -ExclusionPath $ExcludedFolders -Force - Write-Verbose -Message $Localization.DefenderExclusionFoldersListRemoved -Verbose - } -} - -# Add a file to the exclusion from Windows Defender scanning -function AddDefenderExclusionFile -{ - $Title = "Windows Defender" - $Message = $Localization.AddDefenderExclusionFileRequest - $Add = $Localization.Add - $Skip = $Localization.Skip - $Options = "&$Add", "&$Skip" - $DefaultChoice = 1 - - do - { - $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice) - switch ($Result) - { - "0" - { - Add-Type -AssemblyName System.Windows.Forms - $OpenFileDialog = New-Object -TypeName System.Windows.Forms.OpenFileDialog - $OpenFileDialog.Filter = $Localization.AllFilesFilter - $OpenFileDialog.InitialDirectory = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" - $OpenFileDialog.Multiselect = $false - - # Force move the open file dialog to the foreground - $Focus = New-Object -TypeName System.Windows.Forms.Form -Property @{TopMost = $true} - $OpenFileDialog.ShowDialog($Focus) - - if ($OpenFileDialog.FileName) - { - Add-MpPreference -ExclusionPath $OpenFileDialog.FileName -Force - Write-Verbose -Message ("{0}" -f $OpenFileDialog.FileName) -Verbose - } - } - "1" - { - Write-Verbose -Message $Localization.Skipped -Verbose - } - } - } - until ($Result -eq 1) -} - -# Remove all excluded files from Windows Defender scanning -function RemoveDefenderExclusionFiles -{ - if ($null -ne (Get-MpPreference).ExclusionPath) - { - $ExcludedFiles = (Get-Item -Path (Get-MpPreference).ExclusionPath -Force -ErrorAction Ignore | Where-Object -FilterScript {$_.Attributes -notmatch "Directory"}).FullName - $ExcludedFiles | Format-Table -AutoSize -Wrap - Remove-MpPreference -ExclusionPath $ExcludedFiles -Force - Write-Verbose -Message $Localization.DefenderExclusionFilesRemoved -Verbose - } -} - <# .SYNOPSIS - Configure Windows Defender Exploit Guard network protection + Microsoft Defender Exploit Guard network protection + + .PARAMETER Enable + Enable Microsoft Defender Exploit Guard network protection .PARAMETER Disable - Disable Windows Defender Exploit Guard network protection + Disable Microsoft Defender Exploit Guard network protection - .PARAMETER Enable - Enable Windows Defender Exploit Guard network protection + .EXAMPLE + NetworkProtection -Enable .EXAMPLE NetworkProtection -Disable - .EXAMPLE - NetworkProtection -Enable + .NOTES Current user #> function NetworkProtection @@ -7530,47 +7163,49 @@ function NetworkProtection ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable + $Disable ) switch ($PSCmdlet.ParameterSetName) { - "Disable" - { - Set-MpPreference -EnableNetworkProtection Disabled - } "Enable" { Set-MpPreference -EnableNetworkProtection Enabled } + "Disable" + { + Set-MpPreference -EnableNetworkProtection Disabled + } } } <# .SYNOPSIS - Configure detection for potentially unwanted applications and block them + Detection for potentially unwanted applications + + .PARAMETER Enable + Enable detection for potentially unwanted applications and block them .PARAMETER Disable - Enable/disable detection for potentially unwanted applications and block them + Disable detection for potentially unwanted applications and block them - .PARAMETER Enable - Enable/disable detection for potentially unwanted applications and block them + .EXAMPLE + PUAppsDetection -Enable .EXAMPLE PUAppsDetection -Disable - .EXAMPLE - PUAppsDetection -Enable + .NOTES Current user #> function PUAppsDetection @@ -7579,50 +7214,52 @@ function PUAppsDetection ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable + $Disable ) switch ($PSCmdlet.ParameterSetName) { - "Disable" - { - Set-MpPreference -PUAProtection Disabled - } "Enable" { Set-MpPreference -PUAProtection Enabled } + "Disable" + { + Set-MpPreference -PUAProtection Disabled + } } } <# .SYNOPSIS - Configure sandboxing for Windows Defender + Sandboxing for Microsoft Defender + + .PARAMETER Enable + Enable sandboxing for Microsoft Defender .PARAMETER Disable - Disable sandboxing for Windows Defender + Disable sandboxing for Microsoft Defender - .PARAMETER Enable - Enable sandboxing for Windows Defender + .EXAMPLE + DefenderSandbox -Enable .EXAMPLE DefenderSandbox -Disable - .EXAMPLE - DefenderSandbox -Enable + .NOTES + There is a bug in KVM with QEMU: enabling this function causes VM to freeze up during the loading phase of Windows .NOTES - There is a bug in KVM with QEMU: enabling this function causes VM to freeze up during the loading phase of Windows Current user #> function DefenderSandbox @@ -7631,39 +7268,39 @@ function DefenderSandbox ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable + $Disable ) switch ($PSCmdlet.ParameterSetName) { - "Disable" - { - setx /M MP_FORCE_USE_SANDBOX 0 - } "Enable" { setx /M MP_FORCE_USE_SANDBOX 1 } + "Disable" + { + setx /M MP_FORCE_USE_SANDBOX 0 + } } } -# Dismiss Windows Defender offer in the Windows Security about signing in Microsoft account +# Dismiss Microsoft Defender offer in the Windows Security about signing in Microsoft account function DismissMSAccount { New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows Security Health\State" -Name AccountProtection_MicrosoftAccount_Disconnected -PropertyType DWord -Value 1 -Force } -# Dismiss Windows Defender offer in the Windows Security about turning on the SmartScreen filter for Microsoft Edge +# Dismiss Microsoft Defender offer in the Windows Security about turning on the SmartScreen filter for Microsoft Edge function DismissSmartScreenFilter { New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows Security Health\State" -Name AppAndBrowser_EdgeSmartScreenOff -PropertyType DWord -Value 0 -Force @@ -7671,20 +7308,20 @@ function DismissSmartScreenFilter <# .SYNOPSIS - Configure events auditing generated when a process is created or starts - - .PARAMETER Disable - Disable events auditing generated when a process is created or starts + Audit process creation .PARAMETER Enable - Enable events auditing generated when a process is created or starts + Enable events auditing generated when a process is created (starts) - .EXAMPLE - AuditProcess -Disable + .PARAMETER Disable + Disable events auditing generated when a process is created (starts) .EXAMPLE AuditProcess -Enable + .EXAMPLE + AuditProcess -Disable + .NOTES Machine-wide #> @@ -7694,107 +7331,107 @@ function AuditProcess ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable + $Disable ) switch ($PSCmdlet.ParameterSetName) { - "Disable" - { - auditpol /set /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /success:disable /failure:disable - } "Enable" { auditpol /set /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable } + "Disable" + { + auditpol /set /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /success:disable /failure:disable + } } } <# .SYNOPSIS - Configure command line in process creation events - - .PARAMETER Disable - Do not include command line in process creation events + Сommand line auditing .PARAMETER Enable Include command line in process creation events + .PARAMETER Disable + Do not include command line in process creation events + .EXAMPLE - AuditCommandLineProcess -Disable + CommandLineProcessAudit -Enable .EXAMPLE - AuditCommandLineProcess -Enable + CommandLineProcessAudit -Disable .NOTES - In order this feature to work events auditing ("AuditProcess -Enable" function) will be enabled + In order this feature to work events auditing (ProcessAudit -Enable) will be enabled .NOTES Machine-wide #> -function AuditCommandLineProcess +function CommandLineProcessAudit { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable + $Disable ) switch ($PSCmdlet.ParameterSetName) { - "Disable" - { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -Force -ErrorAction SilentlyContinue - } "Enable" { - # Enable events auditing generated when a process is created or starts + # Enable events auditing generated when a process is created (starts) auditpol /set /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -PropertyType DWord -Value 1 -Force } + "Disable" + { + Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -Force -ErrorAction Ignore + } } } <# .SYNOPSIS - Configure "Process Creation" Event Viewer Custom View - - .PARAMETER Disable - Remove "Process Creation" Event Viewer Custom View + The "Process Creation" Event Viewer custom view .PARAMETER Enable - Create "Process Creation" Event Viewer Custom View + Create the "Process Creation" Event Viewer custom view - .EXAMPLE - EventViewerCustomView -Disable + .PARAMETER Disable + Remove the "Process Creation" Event Viewer custom view .EXAMPLE EventViewerCustomView -Enable + .EXAMPLE + EventViewerCustomView -Disable + .NOTES - In order this feature to work events auditing ("AuditProcess -Enable" function) and command line in process creation events will be enabled + In order this feature to work events auditing (ProcessAudit -Enable) and command line in process creation events will be enabled .NOTES Machine-wide @@ -7805,28 +7442,24 @@ function EventViewerCustomView ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable + $Disable ) switch ($PSCmdlet.ParameterSetName) { - "Disable" - { - Remove-Item -Path "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" -Force -ErrorAction SilentlyContinue - } "Enable" { - # Enable events auditing generated when a process is created or starts + # Enable events auditing generated when a process is created (starts) auditpol /set /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable # Include command line in process creation events @@ -7859,25 +7492,29 @@ function EventViewerCustomView # Save ProcessCreation.xml in the UTF-8 with BOM encoding Set-Content -Path "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" -Value $XML -Encoding UTF8 -Force } + "Disable" + { + Remove-Item -Path "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" -Force -ErrorAction SilentlyContinue + } } } <# .SYNOPSIS - Configure logging for all Windows PowerShell modules - - .PARAMETER Disable - Disable logging for all Windows PowerShell modules + Logging for all Windows PowerShell modules .PARAMETER Enable Enable logging for all Windows PowerShell modules - .EXAMPLE - PowerShellModulesLogging -Disable + .PARAMETER Disable + Disable logging for all Windows PowerShell modules .EXAMPLE PowerShellModulesLogging -Enable + .EXAMPLE + PowerShellModulesLogging -Disable + .NOTES Machine-wide #> @@ -7887,26 +7524,21 @@ function PowerShellModulesLogging ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable + $Disable ) switch ($PSCmdlet.ParameterSetName) { - "Disable" - { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging -Name EnableModuleLogging -Force -ErrorAction SilentlyContinue - Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging\ModuleNames -Name * -Force -ErrorAction SilentlyContinue - } "Enable" { if (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging\ModuleNames)) @@ -7916,25 +7548,30 @@ function PowerShellModulesLogging New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging -Name EnableModuleLogging -PropertyType DWord -Value 1 -Force New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging\ModuleNames -Name * -PropertyType String -Value * -Force } + "Disable" + { + Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging -Name EnableModuleLogging -Force -ErrorAction Ignore + Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging\ModuleNames -Name * -Force -ErrorAction Ignore + } } } <# .SYNOPSIS - Configure logging for all PowerShell scripts input to the Windows PowerShell event log - - .PARAMETER Disable - Disable logging for all PowerShell scripts input to the Windows PowerShell event log + Logging for all PowerShell scripts input to the Windows PowerShell event log .PARAMETER Enable Enable logging for all PowerShell scripts input to the Windows PowerShell event log - .EXAMPLE - PowerShellScriptsLogging -Disable + .PARAMETER Disable + Disable logging for all PowerShell scripts input to the Windows PowerShell event log .EXAMPLE PowerShellScriptsLogging -Enable + .EXAMPLE + PowerShellScriptsLogging -Disable + .NOTES Machine-wide #> @@ -7944,25 +7581,21 @@ function PowerShellScriptsLogging ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable + $Disable ) switch ($PSCmdlet.ParameterSetName) { - "Disable" - { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -Name EnableScriptBlockLogging -Force -ErrorAction SilentlyContinue - } "Enable" { if (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging)) @@ -7971,18 +7604,22 @@ function PowerShellScriptsLogging } New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -Name EnableScriptBlockLogging -PropertyType DWord -Value 1 -Force } + "Disable" + { + Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -Name EnableScriptBlockLogging -Force -ErrorAction Ignore + } } } <# .SYNOPSIS - Configure apps and files checking within Microsofot Defender SmartScreen + Microsoft Defender SmartScreen .PARAMETER Disable - Disable apps and files checking within Microsofot Defender SmartScreen + Disable apps and files checking within Microsoft Defender SmartScreen .PARAMETER Enable - Enable apps and files checking within Microsofot Defender SmartScreen + Enable apps and files checking within Microsoft Defender SmartScreen .EXAMPLE AppsSmartScreen -Disable @@ -8027,13 +7664,13 @@ function AppsSmartScreen <# .SYNOPSIS - Configure the Attachment Manager marking files that have been downloaded from the Internet as unsafe + The Attachment Manager .PARAMETER Disable - Disable the Attachment Manager marking files that have been downloaded from the Internet as unsafe + Microsoft Defender SmartScreen doesn't marks downloaded files from the Internet as unsafe .PARAMETER Enable - Enable the Attachment Manager marking files that have been downloaded from the Internet as unsafe + Microsoft Defender SmartScreen marks downloaded files from the Internet as unsafe .EXAMPLE SaveZoneInformation -Disable @@ -8075,14 +7712,14 @@ function SaveZoneInformation } "Enable" { - Remove-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments -Name SaveZoneInformation -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments -Name SaveZoneInformation -Force -ErrorAction Ignore } } } <# .SYNOPSIS - Configure Windows Script Host + Windows Script Host .PARAMETER Disable Disable Windows Script Host @@ -8133,14 +7770,14 @@ function WindowsScriptHost } "Enable" { - Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore } } } <# .SYNOPSIS - Configure Windows Sandbox + Windows Sandbox .PARAMETER Disable Disable Windows Sandbox @@ -8237,19 +7874,19 @@ function WindowsSandbox #region Context menu <# .SYNOPSIS - Configure the "Extract all" item in Windows Installer (.msi) context menu + The "Extract all" item in the Windows Installer (.msi) context menu - .PARAMETER Remove - Remove the "Extract all" item to Windows Installer (.msi) context menu + .PARAMETER Show + Show the "Extract all" item in the Windows Installer (.msi) context menu - .PARAMETER Add - Add the "Extract all" item to Windows Installer (.msi) context menu + .PARAMETER Remove + Hide the "Extract all" item from the Windows Installer (.msi) context menu .EXAMPLE - MSIExtractContext -Remove + MSIExtractContext -Show .EXAMPLE - MSIExtractContext -Add + MSIExtractContext -Hide .NOTES Current user @@ -8260,26 +7897,22 @@ function MSIExtractContext ( [Parameter( Mandatory = $true, - ParameterSetName = "Remove" + ParameterSetName = "Show" )] [switch] - $Remove, + $Show, [Parameter( Mandatory = $true, - ParameterSetName = "Add" + ParameterSetName = "Hide" )] [switch] - $Add + $Hide ) switch ($PSCmdlet.ParameterSetName) { - "Remove" - { - Remove-Item -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract -Recurse -Force -ErrorAction SilentlyContinue - } - "Add" + "Show" { if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract\Command)) { @@ -8290,28 +7923,29 @@ function MSIExtractContext New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract -Name MUIVerb -PropertyType String -Value "@shell32.dll,-37514" -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract -Name Icon -PropertyType String -Value "shell32.dll,-16817" -Force } + "Hide" + { + Remove-Item -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract -Recurse -Force -ErrorAction SilentlyContinue + } + } } <# .SYNOPSIS - Configure the "Install" item in the .cab archives context menu + The "Install" item for the Cabinet (.cab) filenames extensions context menu - .PARAMETER Remove - Remove the "Install" item to the .cab archives context menu + .PARAMETER Show + Show the "Install" item in the Cabinet (.cab) filenames extensions context menu - .PARAMETER Add - Add the "Install" item to the .cab archives context menu + .PARAMETER Hide + Hide the "Install" item from the Cabinet (.cab) filenames extensions context menu .EXAMPLE - CABInstallContext -Remove + CABInstallContext -Show .EXAMPLE - CABInstallContext -Add - - .NOTES - If the .cab file extension type associated to open with a third party app by default, the "Install" context menu item won't be displayed, - so the default association for the .cab file type will be restored forcedly + CABInstallContext -Hide .NOTES Current user @@ -8322,34 +7956,23 @@ function CABInstallContext ( [Parameter( Mandatory = $true, - ParameterSetName = "Remove" + ParameterSetName = "Show" )] [switch] - $Remove, + $Show, [Parameter( Mandatory = $true, - ParameterSetName = "Add" + ParameterSetName = "Hide" )] [switch] - $Add + $Hide ) switch ($PSCmdlet.ParameterSetName) { - "Remove" - { - Remove-Item -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs -Recurse -Force -ErrorAction SilentlyContinue - } - "Add" + "Show" { - # Checking whether the File Explorer is associated with the .cab files - if (-not ((Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.cab\UserChoice -Name ProgId) -eq "CABFolder")) - { - # The "Install" context menu item won't be visible unless the File Explorer was assosiated with the .cab files - Set-Association -ProgramPath CABFolder -Extension .cab -Icon "%SystemRoot%\system32\cabview.dll,0" - } - if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs\Command)) { New-Item -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs\Command -Force @@ -8359,24 +7982,29 @@ function CABInstallContext New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs -Name MUIVerb -PropertyType String -Value "@shell32.dll,-10210" -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs -Name HasLUAShield -PropertyType String -Value "" -Force } + "Hide" + { + Remove-Item -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs -Recurse -Force -ErrorAction SilentlyContinue + } + } } <# .SYNOPSIS - Configure the "Run as different user" item in the .exe files types context menu + The "Run as different user" item for the .exe filename extensions context menu - .PARAMETER Remove - Remove the "Run as different user" item to the .exe files types context menu + .PARAMETER Show + Show the "Run as different user" item in the .exe filename extensions context menu - .PARAMETER Add - Add the "Run as different user" item to the .exe files types context menu + .PARAMETER Hide + Hide the "Run as different user" item from the .exe filename extensions context menu .EXAMPLE - RunAsDifferentUserContext -Remove + RunAsDifferentUserContext -Show .EXAMPLE - RunAsDifferentUserContext -Add + RunAsDifferentUserContext -Hide .NOTES Current user @@ -8387,41 +8015,41 @@ function RunAsDifferentUserContext ( [Parameter( Mandatory = $true, - ParameterSetName = "Remove" + ParameterSetName = "Show" )] [switch] - $Remove, + $Show, [Parameter( Mandatory = $true, - ParameterSetName = "Add" + ParameterSetName = "Hide" )] [switch] - $Add + $Remove ) switch ($PSCmdlet.ParameterSetName) { - "Remove" + "Show" { - New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\exefile\shell\runasuser -Name Extended -PropertyType String -Value "" -Force + Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\exefile\shell\runasuser -Name Extended -Force -ErrorAction Ignore } - "Add" + "Hide" { - Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\exefile\shell\runasuser -Name Extended -Force -ErrorAction Ignore + New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\exefile\shell\runasuser -Name Extended -PropertyType String -Value "" -Force } } } <# .SYNOPSIS - Configure the "Cast to Device" item in the context menu + The "Cast to Device" item in the media files and folders context menu .PARAMETER Hide - Hide the "Cast to Device" item from the context menu + Hide the "Cast to Device" item from the media files and folders context menu .PARAMETER Show - Show the "Cast to Device" item from the context menu + Show the "Cast to Device" item in the media files and folders context menu .EXAMPLE CastToDeviceContext -Hide @@ -8463,14 +8091,14 @@ function CastToDeviceContext } "Show" { - Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -Force -ErrorAction Ignore } } } <# .SYNOPSIS - Configure the "Share" item in the context menu + The "Share" item in the context menu .PARAMETER Hide Hide the "Share" item from the context menu @@ -8518,20 +8146,20 @@ function ShareContext } "Show" { - Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force -ErrorAction Ignore } } } <# .SYNOPSIS - Configure the "Edit with Paint 3D" item in the context menu + The "Edit with Paint 3D" item in the media files context menu .PARAMETER Hide - Hide the "Edit with Paint 3D" item from the context menu + Hide the "Edit with Paint 3D" item from the media files context menu .PARAMETER Show - Show the "Edit with Paint 3D" item in the context menu + Show the "Edit with Paint 3D" item in the media files context menu .EXAMPLE EditWithPaint3DContext -Hide @@ -8566,7 +8194,7 @@ function EditWithPaint3DContext "Hide" { $Extensions = @(".bmp", ".gif", ".jpe", ".jpeg", ".jpg", ".png", ".tif", ".tiff") - foreach ($extension in $extensions) + foreach ($Extension in $Extensions) { New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\$Extension\Shell\3D Edit" -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force } @@ -8584,7 +8212,7 @@ function EditWithPaint3DContext <# .SYNOPSIS - Configure the "Print" item in the .bat and .cmd context menu + The "Print" item in the .bat and .cmd context menu .PARAMETER Hide Hide the "Print" item from the .bat and .cmd context menu @@ -8629,21 +8257,21 @@ function PrintCMDContext } "Show" { - Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\batfile\shell\print -Name ProgrammaticAccessOnly -Force -ErrorAction SilentlyContinue - Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\cmdfile\shell\print -Name ProgrammaticAccessOnly -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\batfile\shell\print -Name ProgrammaticAccessOnly -Force -ErrorAction Ignore + Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\cmdfile\shell\print -Name ProgrammaticAccessOnly -Force -ErrorAction Ignore } } } <# .SYNOPSIS - Configure the "Include in Library" item in the context menu + The "Include in Library" item in the folders and drives context menu .PARAMETER Hide - Hide the "Include in Library" item from the context menu + Hide the "Include in Library" item from the folders and drives context menu .PARAMETER Show - Show the "Include in Library" item in the context menu + Show the "Include in Library" item in the folders and drives context menu .EXAMPLE IncludeInLibraryContext -Hide @@ -8677,18 +8305,18 @@ function IncludeInLibraryContext { "Hide" { - New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers\Library Location" -Name "(default)" -PropertyType String -Value "-{3dad6c5d-2167-4cae-9914-f99e41c12cfa}" -Force + New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\Folder\ShellEx\ContextMenuHandlers\Library Location" -Name "(default)" -PropertyType String -Value "-{3dad6c5d-2167-4cae-9914-f99e41c12cfa}" -Force } "Show" { - New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers\Library Location" -Name "(default)" -PropertyType String -Value "{3dad6c5d-2167-4cae-9914-f99e41c12cfa}" -Force + New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\Folder\ShellEx\ContextMenuHandlers\Library Location" -Name "(default)" -PropertyType String -Value "{3dad6c5d-2167-4cae-9914-f99e41c12cfa}" -Force } } } <# .SYNOPSIS - Configure the "Send to" item in the folders context menu + The "Send to" item in the folders context menu .PARAMETER Hide Hide the "Send to" item from the folders context menu @@ -8739,13 +8367,13 @@ function SendToContext <# .SYNOPSIS - Configure the "Turn on BitLocker" item in the context menu + The "Turn on BitLocker" item in the drives context menu .PARAMETER Hide - Hide the "Turn on BitLocker" item from the context menu + Hide the "Turn on BitLocker" item from the drives context menu .PARAMETER Show - Show the "Turn on BitLocker" item in the context menu + Show the "Turn on BitLocker" item in the drives context menu .EXAMPLE BitLockerContext -Hide @@ -8779,26 +8407,19 @@ function BitLockerContext { "Hide" { - if (Get-WindowsEdition -Online | Where-Object -FilterScript {$_.Edition -eq "Professional" -or $_.Edition -like "Enterprise*"}) + if (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*")}) { - New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\encrypt-bde -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force - New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\encrypt-bde-elev -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force - New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\manage-bde -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force - New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\resume-bde -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force - New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\resume-bde-elev -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force - New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\unlock-bde -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force + if ((Get-BitLockerVolume).ProtectionStatus -eq "Off") + { + New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\encrypt-bde-elev -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force + } } } "Show" { if (Get-WindowsEdition -Online | Where-Object -FilterScript {$_.Edition -eq "Professional" -or $_.Edition -like "Enterprise*"}) { - Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\encrypt-bde -Name ProgrammaticAccessOnly -Force -ErrorAction SilentlyContinue - Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\encrypt-bde-elev -Name ProgrammaticAccessOnly -Force -ErrorAction SilentlyContinue - Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\manage-bde -Name ProgrammaticAccessOnly -Force -ErrorAction SilentlyContinue - Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\resume-bde -Name ProgrammaticAccessOnly -Force -ErrorAction SilentlyContinue - Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\resume-bde-elev -Name ProgrammaticAccessOnly -Force -ErrorAction SilentlyContinue - Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\unlock-bde -Name ProgrammaticAccessOnly -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\encrypt-bde-elev -Name ProgrammaticAccessOnly -Force -ErrorAction Ignore } } } @@ -8806,19 +8427,19 @@ function BitLockerContext <# .SYNOPSIS - Configure the "Bitmap image" item in the "New" context menu + The "Bitmap image" item in the "New" context menu - .PARAMETER Remove - Remove the "Bitmap image" item from the "New" context menu + .PARAMETER Hide + Hide the "Bitmap image" item from the "New" context menu - .PARAMETER Add - Add the "Bitmap image" item to the "New" context menu + .PARAMETER Show + Show the "Bitmap image" item to the "New" context menu .EXAMPLE - BitmapImageNewContext -Remove + BitmapImageNewContext -Hide .EXAMPLE - BitmapImageNewContext -Add + BitmapImageNewContext -Show .NOTES Current user @@ -8829,29 +8450,29 @@ function BitmapImageNewContext ( [Parameter( Mandatory = $true, - ParameterSetName = "Remove" + ParameterSetName = "Hide" )] [switch] - $Remove, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "Add" + ParameterSetName = "Show" )] [switch] - $Add + $Show ) switch ($PSCmdlet.ParameterSetName) { - "Remove" + "Hide" { if ((Get-WindowsCapability -Online -Name "Microsoft.Windows.MSPaint*").State -eq "Installed") { Remove-Item -Path Registry::HKEY_CLASSES_ROOT\.bmp\ShellNew -Force -ErrorAction SilentlyContinue } } - "Add" + "Show" { if ((Get-WindowsCapability -Online -Name "Microsoft.Windows.MSPaint*").State -eq "Installed") { @@ -8884,19 +8505,19 @@ function BitmapImageNewContext <# .SYNOPSIS - Configure the "Rich Text Document" item in the "New" context menu + The "Rich Text Document" item in the "New" context menu - .PARAMETER Remove - Remove the "Rich Text Document" item from the "New" context menu + .PARAMETER Hide + Hide the "Rich Text Document" item from the "New" context menu - .PARAMETER Add - Add the "Rich Text Document" item to the "New" context menu + .PARAMETER Show + Show the "Rich Text Document" item to the "New" context menu .EXAMPLE - RichTextDocumentNewContext -Remove + RichTextDocumentNewContext -Hide .EXAMPLE - RichTextDocumentNewContext -Add + RichTextDocumentNewContext -Show .NOTES Current user @@ -8907,29 +8528,29 @@ function RichTextDocumentNewContext ( [Parameter( Mandatory = $true, - ParameterSetName = "Remove" + ParameterSetName = "Hide" )] [switch] - $Remove, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "Add" + ParameterSetName = "Show" )] [switch] - $Add + $Show ) switch ($PSCmdlet.ParameterSetName) { - "Remove" + "Hide" { if ((Get-WindowsCapability -Online -Name "Microsoft.Windows.WordPad*").State -eq "Installed") { Remove-Item -Path Registry::HKEY_CLASSES_ROOT\.rtf\ShellNew -Force -ErrorAction Ignore } } - "Add" + "Show" { if ((Get-WindowsCapability -Online -Name "Microsoft.Windows.WordPad*").State -eq "Installed") { @@ -8962,19 +8583,19 @@ function RichTextDocumentNewContext <# .SYNOPSIS - Configure the "Compressed (zipped) Folder" item in the "New" context menu + The "Compressed (zipped) Folder" item in the "New" context menu - .PARAMETER Remove - Remove the "Compressed (zipped) Folder" item from the "New" context menu + .PARAMETER Hide + Hide the "Compressed (zipped) Folder" item from the "New" context menu - .PARAMETER Add - Add the "Compressed (zipped) Folder" item to the "New" context menu + .PARAMETER Show + Show the "Compressed (zipped) Folder" item to the "New" context menu .EXAMPLE - CompressedFolderNewContext -Remove + CompressedFolderNewContext -Hide .EXAMPLE - CompressedFolderNewContext -Add + CompressedFolderNewContext -Show .NOTES Current user @@ -8985,26 +8606,26 @@ function CompressedFolderNewContext ( [Parameter( Mandatory = $true, - ParameterSetName = "Remove" + ParameterSetName = "Hide" )] [switch] - $Remove, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "Add" + ParameterSetName = "Show" )] [switch] - $Add + $Show ) switch ($PSCmdlet.ParameterSetName) { - "Remove" + "Hide" { Remove-Item -Path Registry::HKEY_CLASSES_ROOT\.zip\CompressedFolder\ShellNew -Force -ErrorAction Ignore } - "Add" + "Show" { if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\.zip\CompressedFolder\ShellNew)) { @@ -9018,13 +8639,13 @@ function CompressedFolderNewContext <# .SYNOPSIS - Configure the "Open", "Print", and "Edit" context menu items for more than 15 items selected + The "Open", "Print", and "Edit" items if more than 15 files selected .PARAMETER Enable - Enable the "Open", "Print", and "Edit" context menu items for more than 15 items selected + Enable the "Open", "Print", and "Edit" items if more than 15 files selected .PARAMETER Disable - Disable the "Open", "Print", and "Edit" context menu items for more than 15 items selected + Disable the "Open", "Print", and "Edit" items if more than 15 files selected .EXAMPLE MultipleInvokeContext -Enable @@ -9062,14 +8683,14 @@ function MultipleInvokeContext } "Disable" { - Remove-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name MultipleInvokePromptMinimum -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name MultipleInvokePromptMinimum -Force -ErrorAction Ignore } } } <# .SYNOPSIS - Configure the "Look for an app in the Microsoft Store" item in the "Open with" dialog + The "Look for an app in the Microsoft Store" item in the "Open with" dialog .PARAMETER Hide Hide the "Look for an app in the Microsoft Store" item in the "Open with" dialog @@ -9117,58 +8738,7 @@ function UseStoreOpenWith } "Show" { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoUseStoreOpenWith -Force -ErrorAction SilentlyContinue - } - } -} - -<# - .SYNOPSIS - Configure the "Previous Versions" tab in the files and folders context menu and the "Restore previous versions" context menu item - - .PARAMETER Hide - Hide the "Previous Versions" tab from the files and folders context menu and the "Restore previous versions" context menu item - - .PARAMETER Show - Show the "Previous Versions" tab from the files and folders context menu and the "Restore previous versions" context menu item - - .EXAMPLE - PreviousVersionsPage -Hide - - .EXAMPLE - PreviousVersionsPage -Show - - .NOTES - Current user -#> -function PreviousVersionsPage -{ - param - ( - [Parameter( - Mandatory = $true, - ParameterSetName = "Hide" - )] - [switch] - $Hide, - - [Parameter( - Mandatory = $true, - ParameterSetName = "Show" - )] - [switch] - $Show - ) - - switch ($PSCmdlet.ParameterSetName) - { - "Hide" - { - New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name NoPreviousVersionsPage -PropertyType DWord -Value 1 -Force - } - "Show" - { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name NoPreviousVersionsPage -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoUseStoreOpenWith -Force -ErrorAction Ignore } } } diff --git a/Sophia/LTSC/Sophia.ps1 b/Sophia/LTSC/Sophia.ps1 index 3e5e68b9..6cdab69a 100644 --- a/Sophia/LTSC/Sophia.ps1 +++ b/Sophia/LTSC/Sophia.ps1 @@ -2,8 +2,8 @@ .SYNOPSIS Default preset file for "Windows 10 Sophia Script" (LTSC version) - Version: v5.2.8 - Date: 20.06.2021 + Version: v5.2.9 + Date: 12.07.2021 Copyright (c) 2014–2021 farag Copyright (c) 2019–2021 farag & Inestic @@ -49,7 +49,7 @@ .NOTES https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15 - https://habr.com/post/521202/ + https://habr.com/company/skillfactory/blog/553800/ https://forums.mydigitallife.net/threads/powershell-windows-10-sophia-script.81675/ https://www.reddit.com/r/PowerShell/comments/go2n5v/powershell_script_setup_windows_10/ @@ -71,7 +71,7 @@ param Clear-Host -$Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script for LTSC v5.2.8 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & Inestic, 2014–2021" +$Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script for LTSC v5.2.9 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014–2021" Remove-Module -Name Sophia -Force -ErrorAction Ignore Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force @@ -80,19 +80,18 @@ Import-LocalizedData -BindingVariable Global:Localization -FileName Sophia -Base <# .SYNOPSIS - Run the script by specifying the module functions as an argument - Запустить скрипт, указав в качестве аргумента функции модуля + Run the script by specifying functions as an argument + Запустить скрипт, указав в качестве аргумента функции .EXAMPLE .\Sophia.ps1 -Functions "DiagTrackService -Disable", "DiagnosticDataLevel -Minimal", UninstallUWPApps .NOTES Separate functions with a comma + Разделяйте функции запятыми #> if ($Functions) { - # Regardless of functions entered as an argument, the "Checkings" function will be executed first, - # and the "RefreshEnvironment" and "Errors" functions will be executed at the end Invoke-Command -ScriptBlock {Checkings} foreach ($Function in $Functions) @@ -100,6 +99,7 @@ if ($Functions) Invoke-Expression -Command $Function } + # The "RefreshEnvironment" and "Errors" functions will be executed at the end Invoke-Command -ScriptBlock {RefreshEnvironment; Errors} exit @@ -130,20 +130,20 @@ CreateRestorePoint #endregion Protection #region Privacy & Telemetry -# Disable the DiagTrack service, and block connection for the Unified Telemetry Client Outbound Traffic -# Отключить службу DiagTrack и заблокировать соединение для исходящего трафик клиента единой телеметрии +# Disable the "Connected User Experiences and Telemetry" service (DiagTrack), and block the connection for the Unified Telemetry Client Outbound Traffic +# Отключить службу "Функциональные возможности для подключенных пользователей и телеметрия" (DiagTrack) и блокировать соединение для исходящего трафик клиента единой телеметрии DiagTrackService -Disable -# Enable the DiagTrack service, and allow connection for the Unified Telemetry Client Outbound Traffic -# Включить службу DiagTrack и разрешить соединение для исходящего трафик клиента единой телеметрии +# Enable the "Connected User Experiences and Telemetry" service (DiagTrack), and allow the connection for the Unified Telemetry Client Outbound Traffic (default value) +# Включить службу "Функциональные возможности для подключенных пользователей и телеметрия" (DiagTrack) и разрешить подключение для исходящего трафик клиента единой телеметрии (значение по умолчанию) # DiagTrackService -Enable -# Set the OS level of diagnostic data gathering to minimum +# Set the diagnostic data collection to minimum # Установить уровень сбора диагностических сведений ОС на минимальный DiagnosticDataLevel -Minimal -# Set the default OS level of diagnostic data gathering -# Установить уровень сбора диагностических сведений ОС по умолчанию +# Set the diagnostic data collection to default (default value) +# Установить уровень сбора диагностических сведений ОС по умолчанию (значение по умолчанию) # DiagnosticDataLevel -Default # Turn off the Windows Error Reporting @@ -154,13 +154,13 @@ ErrorReporting -Disable # Включить отчеты об ошибках Windows (значение по умолчанию) # ErrorReporting -Enable -# Change the Windows feedback frequency to "Never" +# Change the feedback frequency to "Never" # Изменить частоту формирования отзывов на "Никогда" -WindowsFeedback -Disable +FeedbackFrequency -Never -# Change the Windows Feedback frequency to "Automatically" (default value) +# Change the feedback frequency to "Automatically" (default value) # Изменить частоту формирования отзывов на "Автоматически" (значение по умолчанию) -# WindowsFeedback -Enable +# FeedbackFrequency -Automatically # Turn off the diagnostics tracking scheduled tasks # Отключить задачи диагностического отслеживания @@ -186,21 +186,14 @@ LanguageListAccess -Disable # Позволять веб-сайтам предоставлять местную информацию за счет доступа к списку языков (значение по умолчанию) # LanguageListAccess -Enable -# Do not allow apps to use advertising ID +# Do not allow apps to use advertising ID to make ads more interresting to you based on your app usage # Не разрешать приложениям использовать идентификатор рекламы AdvertisingID -Disable -# Allow apps to use advertising ID (default value) +# Let apps use advertising ID to make ads more interresting to you based on your app usage (default value) # Разрешать приложениям использовать идентификатор рекламы (значение по умолчанию) # AdvertisingID -Enable -# Do not let apps on other devices open and message apps on this device, and vice versa -# Не разрешать приложениям на других устройствах запускать приложения и отправлять сообщения на этом устройстве и наоборот -ShareAcrossDevices -Disable - -# Let apps on other devices open and message apps on this device, and vice versa (default value) -# Разрешать приложениям на других устройствах запускать приложения и отправлять сообщения на этом устройстве и наоборот (значение по умолчанию) -# ShareAcrossDevices -Enable #endregion Privacy & Telemetry #region UI & Personalization @@ -212,11 +205,11 @@ ThisPC -Show # Скрывать "Этот компьютер" на рабочем столе (значение по умолчанию) # ThisPC -Hide -# Do not use check boxes to select items +# Do not use item check boxes # Не использовать флажки для выбора элементов CheckBoxes -Disable -# Use check boxes to select items (default value) +# Use check item check boxes (default value) # Использовать флажки для выбора элементов (значение по умолчанию) # CheckBoxes -Enable @@ -236,7 +229,7 @@ FileExtensions -Show # Скрывать расширения имён файлов файлов (значение по умолчанию) # FileExtensions -Hide -# Do not hide folder merge conflicts +# Show folder merge conflicts # Не скрывать конфликт слияния папок MergeConflicts -Show @@ -244,12 +237,12 @@ MergeConflicts -Show # Скрывать конфликт слияния папок (значение по умолчанию) # MergeConflicts -Hide -# Open File Explorer to: "This PC" -# Открывать проводник для: "Этот компьютер" +# Open File Explorer to "This PC" +# Открывать проводник для "Этот компьютер" OpenFileExplorerTo -ThisPC -# Open File Explorer to: Quick access (default value) -# Открывать проводник для: "Быстрый доступ" (значение по умолчанию) +# Open File Explorer to Quick access (default value) +# Открывать проводник для "Быстрый доступ" (значение по умолчанию) # OpenFileExplorerTo -QuickAccess # When I snap a window, do not show what I can snap next to it @@ -292,6 +285,14 @@ RecycleBinDeleteConfirmation -Enable # Отображать папку "Объемные объекты" в "Этот компьютер" и панели быстрого доступа (значение по умолчанию) # 3DObjects -Show +# Hide recently used files in Quick access +# Скрыть недавно использовавшиеся файлы на панели быстрого доступа +QuickAccessRecentFiles -Hide + +# Show recently used files in Quick access (default value) +# Показать недавно использовавшиеся файлы на панели быстрого доступа (значение по умолчанию) +# QuickAccessRecentFiles -Show + # Hide frequently used folders in Quick access # Скрыть недавно используемые папки на панели быстрого доступа QuickAccessFrequentFolders -Hide @@ -300,19 +301,11 @@ QuickAccessFrequentFolders -Hide # Показать часто используемые папки на панели быстрого доступа (значение по умолчанию) # QuickAccessFrequentFolders -Show -# Do not show recently used files in Quick access -# Не показывать недавно использовавшиеся файлы на панели быстрого доступа -QuickAccessRecentFiles -Hide - -# Show recently used files in Quick access (default value) -# Показать недавно использовавшиеся файлы на панели быстрого доступа (значение по умолчанию) -# QuickAccessRecentFiles -Show - -# Hide Task View button on the taskbar +# Hide the Task View button on the taskbar # Скрывать кнопку Просмотра задач TaskViewButton -Hide -# Show Task View button on the taskbar (default value) +# Show the Task View button on the taskbar (default value) # Показывать кнопку Просмотра задач (значение по умолчанию) # TaskViewButton -Show @@ -348,32 +341,32 @@ TaskbarSearch -Hide # Всегда отображать все значки в области уведомлений TrayIcons -Show -# Do not show all icons in the notification area (default value) -# Не отображать все значки в области уведомлений (значение по умолчанию) +# Hide all icons in the notification area (default value) +# Скрыть все значки в области уведомлений (значение по умолчанию) # TrayIcons -Hide -# View the Control Panel icons by: large icons +# View the Control Panel icons by large icons # Просмотр иконок Панели управления как: крупные значки ControlPanelView -LargeIcons -# View the Control Panel icons by: small icons +# View the Control Panel icons by small icons # Просмотр иконок Панели управления как: маленькие значки # ControlPanelView -SmallIcons -# View the Control Panel icons by: category (default value) +# View the Control Panel icons by category (default value) # Просмотр иконок Панели управления как: категория (значение по умолчанию) # ControlPanelView -Category -# Set the Windows mode color scheme to the dark -# Установить цвет режима Windows по умолчанию на темный -WindowsColorScheme -Dark +# Set the default Windows mode to dark +# Установить режим Windows по умолчанию на темный +WindowsColorMode -Dark -# Set the Windows mode color scheme to the light -# Установить режим цвета для Windows на светлый -# WindowsColorScheme -Light +# Set the default Windows mode to light (default value) +# Установить режим Windows по умолчанию на светлый (значение по умолчанию) +# WindowsColorMode -Light -# Do not show the "New App Installed" indicator -# Не показывать уведомление "Установлено новое приложение" +# Hide the "New App Installed" indicator +# Скрыть уведомление "Установлено новое приложение" NewAppInstalledNotification -Hide # Show the "New App Installed" indicator (default value) @@ -396,11 +389,11 @@ JPEGWallpapersQuality -Max # Установить коэффициент качества обоев рабочего стола в формате JPEG по умолчанию # JPEGWallpapersQuality -Default -# Start Task Manager in expanded mode +# Start Task Manager in the expanded mode # Запускать Диспетчера задач в развернутом виде TaskManagerWindow -Expanded -# Start Task Manager in compact mode (default value) +# Start Task Manager in the compact mode (default value) # Запускать Диспетчера задач в свернутом виде (значение по умолчанию) # TaskManagerWindow -Compact @@ -420,11 +413,11 @@ ShortcutsSuffix -Disable # Дoбaвлять "- яpлык" к имени coздaвaeмых яpлыков (значение по умолчанию) # ShortcutsSuffix -Enable -# Use the PrtScn button to open screen snipping +# Use the Print screen button to open screen snipping # Использовать кнопку PRINT SCREEN, чтобы запустить функцию создания фрагмента экрана PrtScnSnippingTool -Enable -# Do not use the PrtScn button to open screen snipping (default value) +# Do not use the Print screen button to open screen snipping (default value) # Не использовать кнопку PRINT SCREEN, чтобы запустить функцию создания фрагмента экрана (значение по умолчанию) # PrtScnSnippingTool -Disable @@ -432,8 +425,8 @@ PrtScnSnippingTool -Enable # Позволить выбирать метод ввода для каждого окна AppsLanguageSwitch -Enable -# Do not let use a different input method for each app window (default value) -# Не позволять выбирать метод ввода для каждого окна (значение по умолчанию) +# Do not use a different input method for each app window (default value) +# Не использовать метод ввода для каждого окна (значение по умолчанию) # AppsLanguageSwitch -Disable #endregion UI & Personalization @@ -447,14 +440,6 @@ StorageSense -Enable # Выключить Контроль памяти (значение по умолчанию) # StorageSense -Disable -# Run Storage Sense every month -# Запускать Контроль памяти каждый месяц -StorageSenseFrequency -Month - -# Run Storage Sense during low free disk space (default value) -# Запускать Контроль памяти, когда остается мало место на диске (значение по умолчанию) -# StorageSenseFrequency -Default - # Delete temporary files that apps aren't using # Удалять временные файлы, не используемые в приложениях StorageSenseTempFiles -Enable @@ -463,17 +448,17 @@ StorageSenseTempFiles -Enable # Не удалять временные файлы, не используемые в приложениях # StorageSenseTempFiles -Disable -# Delete files in recycle bin if they have been there for over 30 days -# Удалять файлы из корзины, если они находятся в корзине более 30 дней -StorageSenseRecycleBin -Enable +# Run Storage Sense every month +# Запускать Контроль памяти каждый месяц +StorageSenseFrequency -Month -# Do not delete files in recycle bin if they have been there for over 30 days -# Не удалять файлы из корзины, если они находятся в корзине более 30 дней -# StorageSenseRecycleBin -Disable +# Run Storage Sense during low free disk space (default value) +# Запускать Контроль памяти, когда остается мало место на диске (значение по умолчанию) +# StorageSenseFrequency -Default #endregion StorageSense -# Disable hibernation -# Отключить режим гибернации +# Disable hibernation. Do not recommend turning it off on laptops +# Отключить режим гибернации. Не рекомендуется выключать на ноутбуках Hibernate -Disable # Enable hibernate (default value) @@ -482,7 +467,7 @@ Hibernate -Disable # Change the %TEMP% environment variable path to "%SystemDrive%\Temp" # Изменить путь переменной среды для %TEMP% на "%SystemDrive%\Temp" -TempFolder -SystemDrive +# TempFolder -SystemDrive # Change %TEMP% environment variable path to "%LOCALAPPDATA%\Temp" (default value) # Изменить путь переменной среды для %TEMP% на "LOCALAPPDATA%\Temp" (значение по умолчанию) @@ -506,11 +491,11 @@ BSoDStopError -Enable # Choose when to be notified about changes to your computer: never notify # Настройка уведомления об изменении параметров компьютера: никогда не уведомлять -AdminApprovalMode -Disable +AdminApprovalMode -Never # Choose when to be notified about changes to your computer: notify me only when apps try to make changes to my computer (default value) # Настройка уведомления об изменении параметров компьютера: уведомлять меня только при попытках приложений внести изменения в компьютер (значение по умолчанию) -# AdminApprovalMode -Enable +# AdminApprovalMode -Default # Turn on access to mapped drives from app running with elevated permissions with Admin Approval Mode enabled # Включить доступ к сетевым дискам при включенном режиме одобрения администратором при доступе из программ, запущенных с повышенными правами @@ -536,20 +521,20 @@ WaitNetworkStartup -Enable # Никогда не ждать сеть при запуске и входе в систему для рабочих групп (значение по умолчанию) # WaitNetworkStartup -Disable -# Do not let Windows decide which printer should be the default one -# Не разрешать Windows решать, какой принтер должен использоваться по умолчанию +# Do not let Windows manage my default printer +# Не разрешать Windows управлять принтером, используемым по умолчанию WindowsManageDefaultPrinter -Disable -# Let Windows decide which printer should be the default one (default value) -# Разрешать Windows решать, какой принтер должен использоваться по умолчанию (значение по умолчанию) +# Let Windows manage my default printer (default value) +# Разрешать Windows управлять принтером, используемым по умолчанию (значение по умолчанию) # WindowsManageDefaultPrinter -Enable <# Disable the Windows features using the pop-up dialog box Отключить компоненты Windows, используя всплывающее диалоговое окно - If you want to leave "Multimedia settings" element in the advanced settings of Power Options do not disable the "MediaPlayback" feature - Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах схемы управления питанием, не отключайте "MediaPlayback" + If you want to leave "Multimedia settings" element in the advanced settings of Power Options do not disable the "Media Features" feature + Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах схемы управления питанием, не отключайте "Компоненты для работы с медиа" #> WindowsFeatures -Disable @@ -559,10 +544,10 @@ WindowsFeatures -Disable <# Uninstall optional features using the pop-up dialog box - If you want to leave "Multimedia settings" element in the advanced settings of Power Options do not uninstall the "MediaPlayback" feature + If you want to leave "Multimedia settings" element in the advanced settings of Power Options do not uninstall the "Media Features" feature Удалить дополнительные компоненты, используя всплывающее диалоговое окно - Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах схемы управления питанием, не удаляйте компонент "MediaPlayback" + Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах схемы управления питанием, не удаляйте компонент "Компоненты для работы с медиа" #> WindowsCapabilities -Uninstall @@ -579,7 +564,7 @@ UpdateMicrosoftProducts -Enable # UpdateMicrosoftProducts -Disable <# - Set the power plan on "High performance" + Set power plan on "High performance" It isn't recommended to turn on the "High performance" power plan on laptops Установить схему управления питанием на "Высокая производительность" @@ -587,64 +572,64 @@ UpdateMicrosoftProducts -Enable #> PowerPlan -High -# Set the power plan on "Balanced" (default value) +# Set power plan on "Balanced" (default value) # Установить схему управления питанием на "Сбалансированная" (значение по умолчанию) # PowerPlan -Balanced -# Use latest installed .NET runtime for all apps +# Use the latest installed .NET runtime for all apps # Использовать последнюю установленную среду выполнения .NET для всех приложений LatestInstalled.NET -Enable -# Do not use latest installed .NET runtime for all apps (default value) +# Do not use the latest installed .NET runtime for all apps (default value) # Не использовать последнюю установленную версию .NET для всех приложений (значение по умолчанию) # LatestInstalled.NET -Disable # Do not allow the computer to turn off the network adapters to save power # Запретить отключение всех сетевых адаптеров для экономии энергии -PCTurnOffDevice -Disable +NetworkAdaptersSavePower -Disable # Allow the computer to turn off the network adapters to save power (default value) # Разрешить отключение всех сетевых адаптеров для экономии энергии (значение по умолчанию) -# PCTurnOffDevice -Enable +# NetworkAdaptersSavePower -Enable # Override for default input method: English # Переопределить метод ввода по умолчанию: английский -SetInputMethod -English +InputMethod -English # Override for default input method: use language list (default value) # Переопределить метод ввода по умолчанию: использовать список языков (значение по умолчанию) -# SetInputMethod -Default +# InputMethod -Default <# Move user folders location to the root of any drive using the interactive menu User files or folders won't me moved to a new location. Move them manually - They're located in the %SystemDrive%\Users\%Username% folder by default + They're located in the %USERPROFILE% folder by default Переместить пользовательские папки в корень любого диска на выбор с помощью интерактивного меню Пользовательские файлы и папки не будут перемещены в новое расположение. Переместите их вручную - По умолчанию они располагаются в папке %SystemDrive%\Users\%Username% + По умолчанию они располагаются в папке %USERPROFILE% #> SetUserShellFolderLocation -Root <# Select folders for user folders location manually using a folder browser dialog User files or folders won't me moved to a new location. Move them manually - They're located in the %SystemDrive%\Users\%Username% folder by default + They're located in the %USERPROFILE% folder by default Выбрать папки для расположения пользовательских папок вручную, используя диалог "Обзор папок" Пользовательские файлы и папки не будут перемещены в новое расположение. Переместите их вручную - По умолчанию они располагаются в папке %SystemDrive%\Users\%Username% + По умолчанию они располагаются в папке %USERPROFILE% #> # SetUserShellFolderLocation -Custom <# Change user folders location to the default values User files or folders won't me moved to the new location. Move them manually - They're located in the %SystemDrive%\Users\%Username% folder by default + They're located in the %USERPROFILE% folder by default Изменить расположение пользовательских папок на значения по умолчанию Пользовательские файлы и папки не будут перемещены в новое расположение. Переместите их вручную - По умолчанию они располагаются в папке %SystemDrive%\Users\%Username% + По умолчанию они располагаются в папке %%USERPROFILE% #> # SetUserShellFolderLocation -Default @@ -664,11 +649,11 @@ FoldersLaunchSeparateProcess -Enable # Не запускать окна с папками в отдельном процессе (значение по умолчанию) # FoldersLaunchSeparateProcess -Disable -# Disable help look up via F1 +# Disable help lookup via F1 # Отключить открытие справки по нажатию F1 F1HelpPage -Disable -# Enable help look up via F1 (default value) +# Enable help lookup via F1 (default value) # Включить открытие справки по нажатию F1 (значение по умолчанию) # F1HelpPage -Enable @@ -688,20 +673,20 @@ NumLock -Enable # Выключить Caps Lock (значение по умолчанию) # CapsLock -Disable -# Disable StickyKey after tapping the Shift key 5 times +# Turn off pressing the Shift key 5 times to turn Sticky keys # Выключить залипание клавиши Shift после 5 нажатий StickyShift -Disable -# Enable StickyKey after tapping the Shift key 5 times (default value) +# Turn on pressing the Shift key 5 times to turn Sticky keys (default value) # Включить залипание клавиши Shift после 5 нажатий (значение по умолчанию) # StickyShift -Enable -# Disable AutoPlay for all media and devices -# Выключать автозапуск для всех носителей и устройств +# Don't use AutoPlay for all media and devices +# Не использовать автозапуск для всех носителей и устройств Autoplay -Disable -# Enable AutoPlay for all media and devices (default value) -# Включить автозапуск для всех носителей и устройств (значение по умолчанию) +# Use AutoPlay for all media and devices (default value) +# Использовать автозапуск для всех носителей и устройств (значение по умолчанию) # Autoplay -Enable # Disable thumbnail cache removal @@ -722,14 +707,14 @@ NetworkDiscovery -Enable # Automatically adjust active hours for me based on daily usage # Автоматически изменять период активности для этого устройства на основе действий -SmartActiveHours -Enable +ActiveHours -Automatically -# Do not automatically adjust active hours for me based on daily usage (default value) -# Не изменять автоматически период активности для этого устройства на основе действий (значение по умолчанию) -# SmartActiveHours -Disable +# Manually adjust active hours for me based on daily usage (default value) +# Вручную изменять период активности для этого устройства на основе действий (значение по умолчанию) +# ActiveHours -Manually <# - Register app, calculate hash, and set as default for specific extension without the "How do you want to open this?" pop-up - Зарегистрировать приложение, вычислить хэш и установить как приложение по умолчанию для конкретного расширения без всплывающего окна "Каким образом вы хотите открыть этот файл?" + Register app, calculate hash, and associate with an extension with the "How do you want to open this" pop-up hidden + Зарегистрировать приложение, вычислить хэш и ассоциировать его с расширением без всплывающего окна "Каким образом вы хотите открыть этот файл?" Set-Association -ProgramPath "C:\SumatraPDF.exe" -Extension .pdf -Icon "shell32.dll,100" Set-Association -ProgramPath "%ProgramFiles%\Notepad++\notepad++.exe" -Extension .txt -Icon "%ProgramFiles%\Notepad++\notepad++.exe,0" @@ -764,27 +749,11 @@ RunPowerShellShortcut -Elevated #endregion Start menu #region Gaming -# Disable Xbox Game Bar -# Отключить Xbox Game Bar -XboxGameBar -Disable - -# Enable Xbox Game Bar (default value) -# Включить Xbox Game Bar (значение по умолчанию) -# XboxGameBar -Enable - -# Disable Xbox Game Bar tips -# Отключить советы Xbox Game Bar -XboxGameTips -Disable - -# Enable Xbox Game Bar tips (default value) -# Включить советы Xbox Game Bar (значение по умолчанию) -# XboxGameTips -Enable - <# - Set "High performance" in graphics performance preference for an app + Choose an app and set the "High performance" graphics performance for it Only with a dedicated GPU - Установить параметры производительности графики для отдельных приложений на "Высокая производительность" + Выбрать приложение и установить параметры производительности графики на "Высокая производительность" для него Только при наличии внешней видеокарты #> SetAppGraphicsPerformance @@ -836,38 +805,6 @@ TempTask -Register #endregion Scheduled tasks #region Microsoft Defender & Security -# Enable Controlled folder access and add protected folders -# Включить контролируемый доступ к папкам и добавить защищенные папки -AddProtectedFolders - -# Remove all added protected folders -# Удалить все добавленные защищенные папки -# RemoveProtectedFolders - -# Allow an app through Controlled folder access -# Разрешить работу приложения через контролируемый доступ к папкам -AddAppControlledFolder - -# Remove all allowed apps through Controlled folder access -# Удалить все добавленные разрешенные приложение через контролируемый доступ к папкам -# RemoveAllowedAppsControlledFolder - -# Add a folder to the exclusion from Microsoft Defender scanning -# Добавить папку в список исключений сканирования Microsoft Defender -AddDefenderExclusionFolder - -# Remove all excluded folders from Microsoft Defender scanning -# Удалить все папки из списка исключений сканирования Microsoft Defender -# RemoveDefenderExclusionFolders - -# Add a file to the exclusion from Microsoft Defender scanning -# Добавить файл в список исключений сканирования Microsoft Defender -AddDefenderExclusionFile - -# Remove all excluded files from Microsoft Defender scanning -# Удалить все файлы из списка исключений сканирования Microsoft Defender -# RemoveDefenderExclusionFiles - # Enable Microsoft Defender Exploit Guard network protection # Включить защиту сети в Microsoft Defender Exploit Guard NetworkProtection -Enable @@ -905,33 +842,33 @@ DismissMSAccount # Отклонить предложение Microsoft Defender в "Безопасность Windows" включить фильтр SmartScreen для Microsoft Edge DismissSmartScreenFilter -# Enable events auditing generated when a process is created or starts +# Enable events auditing generated when a process is created (starts) # Включить аудит событий, возникающих при создании или запуске процесса AuditProcess -Enable -# Disable events auditing generated when a process is created or starts (default value) +# Disable events auditing generated when a process is created (starts) (default value) # Выключить аудит событий, возникающих при создании или запуске процесса (значение по умолчанию) # AuditProcess -Disable <# Include command line in process creation events - In order this feature to work events auditing will be enabled ("AuditProcess -Enable" function) + In order this feature to work events auditing (ProcessAudit -Enable) will be enabled Включать командную строку в событиях создания процесса - Для того, чтобы работал данный функционал, будет включен аудит событий (функция "AuditProcess -Enable") + Для того, чтобы работал данный функционал, будет включен аудит событий (AuditProcess -Enable) #> -AuditCommandLineProcess -Enable +CommandLineProcessAudit -Enable # Do not include command line in process creation events (default value) # Не включать командную строку в событиях создания процесса (значение по умолчанию) -# AuditCommandLineProcess -Disable +# CommandLineProcessAudit -Disable <# - Create "Process Creation" Event Viewer Custom View - In order this feature to work events auditing ("AuditProcess -Enable" function) and command line in process creation events will be enabled + Create "Process Creation" Event Viewer сustom view + In order this feature to work events auditing (AuditProcess -Enable) and command line in process creation events will be enabled Создать настаиваемое представление "Создание процесса" в Просмотре событий - Для того, чтобы работал данный функционал, буден включен аудит событий (функция "AuditProcess -Enable") и командной строки в событиях создания процесса + Для того, чтобы работал данный функционал, буден включен аудит событий (AuditProcess -Enable) и командной строки в событиях создания процесса #> EventViewerCustomView -Enable @@ -955,12 +892,12 @@ PowerShellScriptsLogging -Enable # Выключить ведение журнала для всех вводимых сценариев PowerShell в журнале событий Windows PowerShell (значение по умолчанию) # PowerShellScriptsLogging -Disable -# Disable apps and files checking within Microsofot Defender SmartScreen -# Выключить проверку приложений и файлов фильтром SmartScreen в Microsoft Defender +# Microsoft Defender SmartScreen doesn't marks downloaded files from the Internet as unsafe +# Microsoft Defender SmartScreen не помечает скачанные файлы из интернета как небезопасные AppsSmartScreen -Disable -# Enable apps and files checking within Microsofot Defender SmartScree (default value) -# Включить проверку приложений и файлов фильтром SmartScreen в Microsoft Defender (значение по умолчанию) +# Microsoft Defender SmartScreen marks downloaded files from the Internet as unsafe (default value) +# Microsoft Defender SmartScreen помечает скачанные файлы из интернета как небезопасные (значение по умолчанию) # AppsSmartScreen -Enable # Disable the Attachment Manager marking files that have been downloaded from the Internet as unsafe @@ -994,43 +931,36 @@ SaveZoneInformation -Disable #endregion Microsoft Defender & Security #region Context menu -# Add the "Extract all" item to Windows Installer (.msi) context menu -# Добавить пункт "Извлечь все" в контекстное меню Windows Installer (.msi) -MSIExtractContext -Add +# Show the "Extract all" item in the Windows Installer (.msi) context menu +# Отобразить пункт "Извлечь все" в контекстное меню Windows Installer (.msi) +MSIExtractContext -Show -# Remove the "Extract all" item from Windows Installer (.msi) context menu (default value) -# Удалить пункт "Извлечь все" из контекстного меню Windows Installer (.msi) (значение по умолчанию) +# Hide the "Extract all" item from the Windows Installer (.msi) context menu (default value) +# Скрыть пункт "Извлечь все" из контекстного меню Windows Installer (.msi) (значение по умолчанию) # MSIExtractContext -Remove -<# - Add the "Install" item to the .cab archives context menu - If the .cab file extension type associated to open with a third party app by default, the "Install" context menu item won't be displayed, - so the default association for the .cab file type will be restored forcedly - - Добавить пункт "Установить" в контекстное меню .cab архивов - Если .cab файлы ассоциированы со сторонним приложением, пункт "Установить" в контекстное меню не будет отображаться, - поэтому принудительно будет восстановлена ассоциация по умолчанию -#> -CABInstallContext -Add +# Show the "Install" item in the Cabinet (.cab) filenames extensions context menu +# Отобразить пункт "Установить" в контекстное меню .cab архивов +CABInstallContext -Show -# Remove the "Install" item from the .cab archives context menu (default value) -# Удалить пункт "Установить" из контекстного меню .cab архивов (значение по умолчанию) -# CABInstallContext -Remove +# Hide the "Install" item from the Cabinet (.cab) filenames extensions context menu (default value) +# Скрыть пункт "Установить" из контекстного меню .cab архивов (значение по умолчанию) +# CABInstallContext -Hide -# Add the "Run as different user" item to the .exe files types context menu -# Добавить пункт "Запуск от имени другого пользователя" в контекстного меню .exe файлов -RunAsDifferentUserContext -Add +# Show the "Run as different user" item to the .exe filename extensions context menu +# Отобразить пункт "Запуск от имени другого пользователя" в контекстное меню .exe файлов +RunAsDifferentUserContext -Show -# Remove the "Run as different user" item from the .exe files types context menu (default value) -# Удалить пункт "Запуск от имени другого пользователя" из контекстное меню .exe файлов (значение по умолчанию) -# RunAsDifferentUserContext -Remove +# Hide the "Run as different user" item from the .exe filename extensions context menu (default value) +# Скрыть пункт "Запуск от имени другого пользователя" из контекстное меню .exe файлов (значение по умолчанию) +# RunAsDifferentUserContext -Hide -# Hide the "Cast to Device" item from the context menu -# Скрыть пункт "Передать на устройство" из контекстного меню +# Hide the "Cast to Device" item from the media files and folders context menu +# Скрыть пункт "Передать на устройство" из контекстного меню медиа-файлов и папок CastToDeviceContext -Hide -# Show the "Cast to Device" item in the context menu (default value) -# Показывать пункт "Передать на устройство" в контекстном меню (значение по умолчанию) +# Show the "Cast to Device" item in the media files and folders context menu (default value) +# Показывать пункт "Передать на устройство" в контекстном меню медиа-файлов и папок (значение по умолчанию) # CastToDeviceContext -Show # Hide the "Share" item from the context menu @@ -1041,12 +971,12 @@ ShareContext -Hide # Показывать пункт "Отправить" (поделиться) в контекстном меню (значение по умолчанию) # ShareContext -Show -# Hide the "Edit with Paint 3D" item from the context menu -# Скрыть пункт "Изменить с помощью Paint 3D" из контекстного меню +# Hide the "Edit with Paint 3D" item from the media files context menu +# Скрыть пункт "Изменить с помощью Paint 3D" из контекстного меню медиа-файлов EditWithPaint3DContext -Hide -# Show the "Edit with Paint 3D" item in the context menu (default value) -# Показывать пункт "Изменить с помощью Paint 3D" в контекстном меню (значение по умолчанию) +# Show the "Edit with Paint 3D" item in the media files context menu (default value) +# Показывать пункт "Изменить с помощью Paint 3D" в контекстном меню медиа-файлов (значение по умолчанию) # EditWithPaint3DContext -Show # Hide the "Print" item from the .bat and .cmd context menu @@ -1057,12 +987,12 @@ PrintCMDContext -Hide # Показывать пункт "Печать" в контекстном меню .bat и .cmd файлов (значение по умолчанию) # PrintCMDContext -Show -# Hide the "Include in Library" item from the context menu -# Скрыть пункт "Добавить в библиотеку" из контекстного меню +# Hide the "Include in Library" item from the folders and drives context menu +# Скрыть пункт "Добавить в библиотеку" из контекстного меню папок и дисков IncludeInLibraryContext -Hide -# Show the "Include in Library" item in the context menu (default value) -# Показывать пункт "Добавить в библиотеку" в контекстном меню (значение по умолчанию) +# Show the "Include in Library" item in the folders and drives context menu (default value) +# Показывать пункт "Добавить в библиотеку" в контекстном меню папок и дисков (значение по умолчанию) # IncludeInLibraryContext -Show # Hide the "Send to" item from the folders context menu @@ -1073,37 +1003,37 @@ SendToContext -Hide # Показывать пункт "Отправить" в контекстном меню папок (значение по умолчанию) # SendToContext -Show -# Hide the "Turn on BitLocker" item from the context menu -# Скрыть пункт "Включить BitLocker" из контекстного меню +# Hide the "Turn on BitLocker" item from the drives context menu +# Скрыть пункт "Включить BitLocker" из контекстного меню дисков BitLockerContext -Hide -# Show the "Turn on BitLocker" item in the context menu (default value) -# Показывать пункт "Включить BitLocker" в контекстном меню (значение по умолчанию) +# Show the "Turn on BitLocker" item in the drives context menu (default value) +# Показывать пункт "Включить BitLocker" в контекстном меню дисков (значение по умолчанию) # BitLockerContext -Show -# Remove the "Bitmap image" item from the "New" context menu -# Удалить пункт "Точечный рисунок" из контекстного меню "Создать" -BitmapImageNewContext -Remove +# Hide the "Bitmap image" item from the "New" context menu +# Скрыть пункт "Точечный рисунок" из контекстного меню "Создать" +BitmapImageNewContext -Hide -# Add the "Bitmap image" item to the "New" context menu (default value) +# Show the "Bitmap image" item to the "New" context menu (default value) # Восстановить пункт "Точечный рисунок" в контекстного меню "Создать" (значение по умолчанию) -# BitmapImageNewContext -Add +# BitmapImageNewContext -Show -# Remove the "Rich Text Document" item from the "New" context menu -# Удалить пункт "Документ в формате RTF" из контекстного меню "Создать" -RichTextDocumentNewContext -Remove +# Hide the "Rich Text Document" item from the "New" context menu +# Скрыть пункт "Документ в формате RTF" из контекстного меню "Создать" +RichTextDocumentNewContext -Hide -# Add the "Rich Text Document" item to the "New" context menu (default value) +# Show the "Rich Text Document" item to the "New" context menu (default value) # Восстановить пункт "Документ в формате RTF" в контекстного меню "Создать" (значение по умолчанию) -# RichTextDocumentNewContext -Add +# RichTextDocumentNewContext -Show -# Remove the "Compressed (zipped) Folder" item from the "New" context menu -# Удалить пункт "Сжатая ZIP-папка" из контекстного меню "Создать" -CompressedFolderNewContext -Remove +# Hide the "Compressed (zipped) Folder" item from the "New" context menu +# Скрыть пункт "Сжатая ZIP-папка" из контекстного меню "Создать" +CompressedFolderNewContext -Hide -# Add the "Compressed (zipped) Folder" item to the "New" context menu (default value) +# Show the "Compressed (zipped) Folder" item to the "New" context menu (default value) # Восстановить пункт "Сжатая ZIP-папка" в контекстном меню "Создать" (значение по умолчанию) -# CompressedFolderNewContext -Add +# CompressedFolderNewContext -Show # Enable the "Open", "Print", and "Edit" context menu items for more than 15 items selected # Включить элементы контекстного меню "Открыть", "Изменить" и "Печать" при выделении более 15 элементов @@ -1120,14 +1050,6 @@ UseStoreOpenWith -Hide # Show the "Look for an app in the Microsoft Store" item in the "Open with" dialog (default value) # Отображать пункт "Поиск приложения в Microsoft Store" в диалоге "Открыть с помощью" (значение по умолчанию) # UseStoreOpenWith -Show - -# Hide the "Previous Versions" tab from the files and folders context menu and the "Restore previous versions" context menu item -# Скрыть вкладку "Предыдущие версии" в свойствах файлов и папок, а также пункт контекстного меню "Восстановить прежнюю версию" -PreviousVersionsPage -Hide - -# Show the "Previous Versions" tab from files and folders context menu and also the "Restore previous versions" context menu item (default value) -# Отображать вкладку "Предыдущие версии" в свойствах файлов и папок, а также пункт контекстного меню "Восстановить прежнюю версию" (значение по умолчанию) -# PreviousVersionsPage -Show #endregion Context menu <#