diff --git a/Sophia/PowerShell 7/Functions.ps1 b/Sophia/PowerShell 7/Functions.ps1 index b07c94c6..cc8e4bb1 100644 --- a/Sophia/PowerShell 7/Functions.ps1 +++ b/Sophia/PowerShell 7/Functions.ps1 @@ -2,8 +2,8 @@ .SYNOPSIS The TAB completion for functions and their arguments - Version: v5.10.8 - Date: 20.06.2021 + Version: v5.11 + 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,12 +46,13 @@ function Sophia Invoke-Expression -Command $Function } + # The "RefreshEnvironment" and "Errors" functions will be executed at the end Invoke-Command -ScriptBlock {RefreshEnvironment; Errors} } Clear-Host -$Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script v5.10.8 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & Inestic, 2014–2021" +$Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script v5.11 | 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 @@ -132,7 +118,7 @@ $Parameters = @{ "UnpinTaskbarShortcuts" + " " + "-" + $ParameterSet + " " + $ValidValue | Where-Object -FilterScript {$_ -like "*$wordToComplete*"} | ForEach-Object -Process {"`"$_`""} } - # "UnpinTaskbarShortcuts -Shortcuts " construction + # The "UnpinTaskbarShortcuts -Shortcuts " construction "UnpinTaskbarShortcuts" + " " + "-" + $ParameterSet + " " + ($ValidValues -join ", ") | Where-Object -FilterScript {$_ -like "*$wordToComplete*"} | ForEach-Object -Process {"`"$_`""} } @@ -181,4 +167,5 @@ 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 "`nUninstallUWPApps, `"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/PowerShell 7/Localizations/de-DE/Sophia.psd1 b/Sophia/PowerShell 7/Localizations/de-DE/Sophia.psd1 index 73353410..5e82fa4d 100644 --- a/Sophia/PowerShell 7/Localizations/de-DE/Sophia.psd1 +++ b/Sophia/PowerShell 7/Localizations/de-DE/Sophia.psd1 @@ -1,7 +1,11 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Das Skript unterstützt nur Windows 10 x64 UnsupportedOSBuild = Das Skript unterstützt Windows 10 2004/20H2/21H1-Versionen und höher +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 +UpdateWarning = Ihr Windows 10-Build: {0}.{1}.{2}.{3}. Unterstützter Build: 10.0.19043.1052 und höher 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 @@ -37,18 +41,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/PowerShell 7/Localizations/en-US/Sophia.psd1 b/Sophia/PowerShell 7/Localizations/en-US/Sophia.psd1 index a79f71a6..03c65ba7 100644 --- a/Sophia/PowerShell 7/Localizations/en-US/Sophia.psd1 +++ b/Sophia/PowerShell 7/Localizations/en-US/Sophia.psd1 @@ -1,7 +1,11 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = The script supports Windows 10 x64 only UnsupportedOSBuild = The script supports Windows 10 2004/20H2/21H1 versions and higher +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 +UpdateWarning = Your Windows 10 build: {0}.{1}.{2}.{3}. Supported build: 10.0.19043.1052 and higher 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 @@ -20,7 +24,7 @@ UserFolderSelect = Select a folder for the "{0}" folder UserDefaultFolder = Would you like to change the location of the "{0}" folder to the default value? ReservedStorageIsInUse = This operation is not supported when reserved storage is in use\nPlease wait for any servicing operations to complete and then try again later ShortcutPinning = The "{0}" shortcut is being pinned to Start -UninstallUWPForAll = For All Users +UninstallUWPForAll = For all users UWPAppsTitle = UWP Apps WSLUpdateDownloading = Downloading the Linux kernel update package... ~14 MB WSLUpdateInstalling = Installing the Linux kernel update package... @@ -37,18 +41,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 @@ -62,10 +57,10 @@ Enable = Enable EXEFilesFilter = *.exe|*.exe|All Files (*.*)|*.* FolderSelect = Select a folder FilesWontBeMoved = Files will not be moved -FourHours = 4 Hours -HalfHour = 30 Minutes +FourHours = 4 hours +HalfHour = 30 minutes Install = Install -Minute = 1 Minute +Minute = 1 minute NoData = Nothing to display NoInternetConnection = No Internet connection NoResponse = A connection could not be established with https://store.rg-adguard.net diff --git a/Sophia/PowerShell 7/Localizations/es-ES/Sophia.psd1 b/Sophia/PowerShell 7/Localizations/es-ES/Sophia.psd1 index 65081434..18c1f343 100644 --- a/Sophia/PowerShell 7/Localizations/es-ES/Sophia.psd1 +++ b/Sophia/PowerShell 7/Localizations/es-ES/Sophia.psd1 @@ -1,8 +1,12 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = El script sólo es compatible con Windows 10 x64 UnsupportedOSBuild = El script es compatible con versión Windows 10 2004/20H2/21H1 y superiores +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 +UpdateWarning = Su build de Windows 10: {0}.{1}.{2}.{3}. Compilación compatible: 10.0.19043.1052 y superiores +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 @@ -37,18 +41,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/PowerShell 7/Localizations/fr-FR/Sophia.psd1 b/Sophia/PowerShell 7/Localizations/fr-FR/Sophia.psd1 index 02abd253..afc212ae 100644 --- a/Sophia/PowerShell 7/Localizations/fr-FR/Sophia.psd1 +++ b/Sophia/PowerShell 7/Localizations/fr-FR/Sophia.psd1 @@ -1,7 +1,11 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Le script supporte uniquement Windows 10 x64 UnsupportedOSBuild = Le script supporte les versions Windows 10 2004/20H2/21H1 et ultérieures +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 +UpdateWarning = Votre version de Windows 10 : {0}.{1}.{2}.{3}. Version prise en charge : 10.0.19043.1052 et ultérieures 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é @@ -37,18 +41,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/PowerShell 7/Localizations/hu-HU/Sophia.psd1 b/Sophia/PowerShell 7/Localizations/hu-HU/Sophia.psd1 index 11006f68..1aa28d00 100644 --- a/Sophia/PowerShell 7/Localizations/hu-HU/Sophia.psd1 +++ b/Sophia/PowerShell 7/Localizations/hu-HU/Sophia.psd1 @@ -1,7 +1,11 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = A szkript csak a Windows 10 64 bites verziót támogatja UnsupportedOSBuild = A szkript a Windows 10 2004/20H2/21H1 és újabb kiadásokat támogatja +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 +Win10TweakerWarning = Valószínűleg az operációs rendszerét a Win 10 Tweaker backdoor segítségével fertőzték meg. +UpdateWarning = Az Ön Windows 10 építése: {0}.{1}.{2}.{3}. Támogatott build: 10.0.19043.1052 és magasabb verziószámok 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? ControlledFolderAccessDisabled = Vezérelt mappához való hozzáférés kikapcsolva @@ -37,18 +41,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/PowerShell 7/Localizations/it-IT/Sophia.psd1 b/Sophia/PowerShell 7/Localizations/it-IT/Sophia.psd1 index ea4842c9..ff5271bb 100644 --- a/Sophia/PowerShell 7/Localizations/it-IT/Sophia.psd1 +++ b/Sophia/PowerShell 7/Localizations/it-IT/Sophia.psd1 @@ -1,7 +1,11 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Lo script supporta solo Windows 10 x64 UnsupportedOSBuild = Lo script supporta Windows 10, 2004/20H2/21H1 versioni e superiori +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 +UpdateWarning = La tua build di Windows 10: {0}.{1}.{2}.{3}. Build supportata: 10.0.19043.1052 e successive 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 @@ -37,18 +41,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/PowerShell 7/Localizations/pt-BR/Sophia.psd1 b/Sophia/PowerShell 7/Localizations/pt-BR/Sophia.psd1 index 154a6620..aeba1d9d 100644 --- a/Sophia/PowerShell 7/Localizations/pt-BR/Sophia.psd1 +++ b/Sophia/PowerShell 7/Localizations/pt-BR/Sophia.psd1 @@ -1,7 +1,11 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = O script suporta somente Windows 10 x64 UnsupportedOSBuild = O script suporta versões Windows 10 2004/20H2/21H1 e superior +UnsupportedLanguageMode = A sessão PowerShell em funcionamento em um modo de linguagem limitada +LoggedInUserNotAdmin = O usuário logado não tem direitos de administrador 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 +UpdateWarning = La tua build di Windows 10: {0}.{1}.{2}.{3}. Build supportata: 10.0.19043.1052 e successive 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 @@ -37,18 +41,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 diff --git a/Sophia/PowerShell 7/Localizations/ru-RU/Sophia.psd1 b/Sophia/PowerShell 7/Localizations/ru-RU/Sophia.psd1 index 67e4b997..af869a24 100644 --- a/Sophia/PowerShell 7/Localizations/ru-RU/Sophia.psd1 +++ b/Sophia/PowerShell 7/Localizations/ru-RU/Sophia.psd1 @@ -1,7 +1,11 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Скрипт поддерживает только Windows 10 x64 UnsupportedOSBuild = Скрипт поддерживает только Windows 10 версии 2004/20H2/21H1 и выше -UnsupportedISE = Скрипт не поддерживает работу через Windows PowerShell ISE +UnsupportedLanguageMode = Сессия PowerShell работает в ограниченном режиме +LoggedInUserNotAdmin = Текущий вошедший пользователь не обладает правами администратора +UnsupportedISE = Скрипт не поддерживает работу через Windows PowerShell ISE] +Win10TweakerWarning = Ваша ОС, возможно, через бэкдор в Win 10 Tweaker заражена трояном +UpdateWarning = Ваш билд Windows 10: {0}.{1}.{2}.{3}. Поддерживаемый билд: 10.0.19043.1052 и выше UnsupportedRelease = Обнаружена новая версия CustomizationWarning = \nВы настроили все функции в пресет-файле Sophia.ps1 перед запуском Sophia Script? ControlledFolderAccessDisabled = Контролируемый доступ к папкам выключен @@ -37,18 +41,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/PowerShell 7/Localizations/tr-TR/Sophia.psd1 b/Sophia/PowerShell 7/Localizations/tr-TR/Sophia.psd1 index 50f28aac..2d63657f 100644 --- a/Sophia/PowerShell 7/Localizations/tr-TR/Sophia.psd1 +++ b/Sophia/PowerShell 7/Localizations/tr-TR/Sophia.psd1 @@ -1,7 +1,11 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Bu betik sadece Windows 10 x64 destekliyor UnsupportedOSBuild = Bu betik sadece Windows 10 2004/20H2/21H1 sürüm ve üstünü destekliyor +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ı +UpdateWarning = Windows 10 yapınız: {0}.{1}.{2}.{3}. Desteklenen yapı: 10.0.19043.1052 ve üstünü destekliyor 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ı @@ -37,18 +41,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/PowerShell 7/Localizations/uk-UA/Sophia.psd1 b/Sophia/PowerShell 7/Localizations/uk-UA/Sophia.psd1 index 707481b1..9695269f 100644 --- a/Sophia/PowerShell 7/Localizations/uk-UA/Sophia.psd1 +++ b/Sophia/PowerShell 7/Localizations/uk-UA/Sophia.psd1 @@ -1,7 +1,11 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = Скрипт підтримує тільки Windows 10 x64 UnsupportedOSBuild = Скрипт підтримує тільки Windows 10 версії 2004/20H2/21H1 та вище +UnsupportedLanguageMode = Сесія PowerShell працює в обмеженому режимі +LoggedInUserNotAdmin = Поточний увійшов користувач не володіє правами адміністратора UnsupportedISE = Скрипт не підтримує роботу через Windows PowerShell ISE +Win10TweakerWarning = Ваша ОС, можливо, через бекдор в Win 10 Tweaker заражена трояном +UpdateWarning = Ваш білд Windows 10: {0}. {1}. {2}. {3}. Підтримуваний білд: 10.0.19043.1052 та вище UnsupportedRelease = Виявлено нову версію CustomizationWarning = \nВи налаштували всі функції в пресет-файлі Sophia.ps1 перед запуском Sophia Script? ControlledFolderAccessDisabled = Контрольований доступ до папок вимкнений @@ -37,18 +41,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/PowerShell 7/Localizations/zh-CN/Sophia.psd1 b/Sophia/PowerShell 7/Localizations/zh-CN/Sophia.psd1 index ab2dd6ce..17709f3c 100644 --- a/Sophia/PowerShell 7/Localizations/zh-CN/Sophia.psd1 +++ b/Sophia/PowerShell 7/Localizations/zh-CN/Sophia.psd1 @@ -1,10 +1,14 @@ ConvertFrom-StringData -StringData @' UnsupportedOSBitness = 该脚本仅支持Windows 10 x64 UnsupportedOSBuild = 该脚本支持Windows 10版本2004/20H2/21H1和更高版本 +UnsupportedLanguageMode = PowerShell会话在有限的语言模式下运行 +LoggedInUserNotAdmin = 登录的用户没有管理员的权利 UnsupportedISE = 该脚本不支持通过Windows PowerShell ISE运行 +Win10TweakerWarning = 可能你的操作系统是通过“Win 10 Tweaker”后门感染的 +UpdateWarning = 您的Windows 10构建。{0}.{1}.{2}.{3}. 支持的构建。10.0.19043.1052和更高版本 UnsupportedRelease = 找到新版本 -CustomizationWarning = \n在运行Sophia Script之前,您是否已自定义Sophia.ps1预设文件中的每个功能? -ControlledFolderAccessDisabled = “受控文件夹访问”禁用 +CustomizationWarning = \n在运行Sophia Script之前,您是否已自定义Sophia.ps1预设文件中的每个函数? +ControlledFolderAccessDisabled = “受控文件夹访问”已禁用 ScheduledTasks = 计划任务 OneDriveUninstalling = 卸载OneDrive…… OneDriveInstalling = OneDrive正在安装...... @@ -37,18 +41,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/PowerShell 7/Manifest/Sophia.psd1 b/Sophia/PowerShell 7/Manifest/Sophia.psd1 index fca843ee..ed0d6baa 100644 --- a/Sophia/PowerShell 7/Manifest/Sophia.psd1 +++ b/Sophia/PowerShell 7/Manifest/Sophia.psd1 @@ -1,6 +1,6 @@ @{ RootModule = '..\Module\Sophia.psm1' - ModuleVersion = '5.10.8' + ModuleVersion = '5.11' GUID = 'aa0b47a7-1770-4b5d-8c9f-cc6c505bcc7a' Author = 'Dmitry "farag" Nefedov' Copyright = '(c) 2014–2021 farag & Inestic. All rights reserved' diff --git a/Sophia/PowerShell 7/Module/Sophia.psm1 b/Sophia/PowerShell 7/Module/Sophia.psm1 index a0ea2aa1..4524ef03 100644 --- a/Sophia/PowerShell 7/Module/Sophia.psm1 +++ b/Sophia/PowerShell 7/Module/Sophia.psm1 @@ -1,9 +1,9 @@ <# .SYNOPSIS - "Windows 10 Sophia Script" is a PowerShell module for Windows 10 fine-tuning and automating the routine tasks + Sophia Script is a PowerShell module for Windows 10 fine-tuning and automating the routine tasks - Version: v5.10.8 - Date: 20.06.2021 + Version: v5.11 + 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/ #> @@ -68,7 +68,7 @@ function Checkings } # Detect the OS build version - switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -ge 19041) + switch (((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -ge 19041) -and ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -lt 22000)) { $false { @@ -77,14 +77,66 @@ 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 } - # Checking if the current module version is the latest one + # 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 + } + + # Check whether the OS minor buils version is 1052 minimum + switch ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -ge 1052) + { + $false + { + $Version = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" + $Version = $Version.CurrentMajorVersionNumber, $Version.CurrentMinorVersionNumber, $Version.CurrentBuild, $Version.UBR + + Write-Warning -Message ($Localization.UpdateWarning -f $Version) + + exit + } + } + + # Check if the current module version is the latest one try { $LatestRelease = (Invoke-RestMethod -Uri "https://api.github.com/repos/farag2/Windows-10-Sophia-Script/releases/latest").tag_name @@ -127,6 +179,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" @@ -189,7 +246,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 @@ -205,13 +262,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 @@ -228,49 +285,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 +390,7 @@ function DiagnosticDataLevel <# .SYNOPSIS - Configure the Windows Error Reporting + Windows Error Reporting .PARAMETER Disable Turn off Windows Error Reporting @@ -383,7 +442,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 +452,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 +498,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 +507,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 +523,8 @@ function WindowsFeedback .NOTES A pop-up dialog box lets a user select tasks + + .NOTES Current user #> function ScheduledTasks @@ -472,17 +533,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 +595,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 +814,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 +843,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 +893,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 +944,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 @@ -949,58 +1010,7 @@ 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 - } - } -} - -<# - .SYNOPSIS - Configure the Windows welcome experiences after updates and occasionally when I sign in to highlight what's new and suggested + The Windows welcome experiences after updates and occasionally when I sign in to highlight what's new and suggested .PARAMETER Hide Hide the Windows welcome experiences after updates and occasionally when I sign in to highlight what's new and suggested @@ -1051,20 +1061,20 @@ function WindowsWelcomeExperience <# .SYNOPSIS - Configure getting tip, trick, and suggestions as you use Windows - - .PARAMETER Disable - Do not get tip, trick, and suggestions as you use Windows + Getting tip, trick, and suggestions as you use Windows .PARAMETER Enable Get tip, trick, and suggestions as you use Windows - .EXAMPLE - WindowsTips -Disable + .PARAMETER Disable + Do not get tip, trick, and suggestions as you use Windows .EXAMPLE WindowsTips -Enable + .EXAMPLE + WindowsTips -Disable + .NOTES Current user #> @@ -1074,17 +1084,17 @@ function WindowsTips ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) switch ($PSCmdlet.ParameterSetName) @@ -1102,13 +1112,13 @@ function WindowsTips <# .SYNOPSIS - Configure suggested content in the Settings app + Suggested content in the Settings app .PARAMETER Hide - Hide suggested content in the Settings app + Hide from me suggested content in the Settings app .PARAMETER Show - Show suggested content in the Settings app + Show me suggested content in the Settings app .EXAMPLE SettingsSuggestedContent -Hide @@ -1125,39 +1135,39 @@ function SettingsSuggestedContent ( [Parameter( Mandatory = $true, - ParameterSetName = "Show" + ParameterSetName = "Hide" )] [switch] - $Show, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "Hide" + ParameterSetName = "Show" )] [switch] - $Hide + $Show ) switch ($PSCmdlet.ParameterSetName) { - "Show" - { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338393Enabled -PropertyType DWord -Value 1 -Force - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-353694Enabled -PropertyType DWord -Value 1 -Force - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-353696Enabled -PropertyType DWord -Value 1 -Force - } "Hide" { New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338393Enabled -PropertyType DWord -Value 0 -Force New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-353694Enabled -PropertyType DWord -Value 0 -Force New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-353696Enabled -PropertyType DWord -Value 0 -Force } + "Show" + { + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338393Enabled -PropertyType DWord -Value 1 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-353694Enabled -PropertyType DWord -Value 1 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-353696Enabled -PropertyType DWord -Value 1 -Force + } } } <# .SYNOPSIS - Configure automatic installing suggested apps + Automatic installing suggested apps .PARAMETER Disable Turn off automatic installing suggested apps @@ -1180,35 +1190,35 @@ function AppsSilentInstalling ( [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\ContentDeliveryManager -Name SilentInstalledAppsEnabled -PropertyType DWord -Value 1 -Force - } "Disable" { New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SilentInstalledAppsEnabled -PropertyType DWord -Value 0 -Force } + "Enable" + { + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SilentInstalledAppsEnabled -PropertyType DWord -Value 1 -Force + } } } <# .SYNOPSIS - Configure ways I can finish setting up my device to get the most out of Windows + Ways I can finish setting up my device to get the most out of Windows .PARAMETER Disable Do not suggest ways I can finish setting up my device to get the most out of Windows @@ -1231,43 +1241,43 @@ function WhatsNewInWindows ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) switch ($PSCmdlet.ParameterSetName) { - "Enable" + "Disable" { if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\UserProfileEngagement)) { New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\UserProfileEngagement -Force } - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\UserProfileEngagement -Name ScoobeSystemSettingEnabled -PropertyType DWord -Value 1 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\UserProfileEngagement -Name ScoobeSystemSettingEnabled -PropertyType DWord -Value 0 -Force } - "Disable" + "Enable" { if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\UserProfileEngagement)) { New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\UserProfileEngagement -Force } - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\UserProfileEngagement -Name ScoobeSystemSettingEnabled -PropertyType DWord -Value 0 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\UserProfileEngagement -Name ScoobeSystemSettingEnabled -PropertyType DWord -Value 1 -Force } } } <# .SYNOPSIS - Configure tailored experiences based on the diagnostic data setting + Tailored experiences based on the diagnostic data setting .PARAMETER Disable Do not offer tailored experiences based on the diagnostic data setting @@ -1290,35 +1300,35 @@ function TailoredExperiences ( [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\Privacy -Name TailoredExperiencesWithDiagnosticDataEnabled -PropertyType DWord -Value 1 -Force - } "Disable" { New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy -Name TailoredExperiencesWithDiagnosticDataEnabled -PropertyType DWord -Value 0 -Force } + "Enable" + { + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy -Name TailoredExperiencesWithDiagnosticDataEnabled -PropertyType DWord -Value 1 -Force + } } } <# .SYNOPSIS - Configure Bing search in the Start Menu (for the USA only) + Bing search in the Start Menu (for the USA only) .PARAMETER Disable Disable Bing search in the Start Menu (for the USA only) @@ -1341,28 +1351,21 @@ function BingSearch ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - if ((Get-WinHomeLocation).GeoId -eq 244) - { - Remove-ItemProperty -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableSearchBoxSuggestions -Force -ErrorAction SilentlyContinue - } - } "Disable" { if ((Get-WinHomeLocation).GeoId -eq 244) @@ -1374,6 +1377,13 @@ function BingSearch New-ItemProperty -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableSearchBoxSuggestions -PropertyType DWord -Value 1 -Force } } + "Enable" + { + if ((Get-WinHomeLocation).GeoId -eq 244) + { + Remove-ItemProperty -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableSearchBoxSuggestions -Force -ErrorAction Ignore + } + } } } #endregion Privacy & Telemetry @@ -1381,7 +1391,7 @@ function BingSearch #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 @@ -1429,20 +1439,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 @@ -1487,7 +1497,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 @@ -1538,7 +1548,7 @@ function HiddenItems <# .SYNOPSIS - Configure the display of file name extensions + File name extensions .PARAMETER Show Show file name extensions @@ -1589,7 +1599,7 @@ function FileExtensions <# .SYNOPSIS - Configure folder merge conflicts + Folder merge conflicts .PARAMETER Show Show folder merge conflicts @@ -1691,14 +1701,14 @@ function OpenFileExplorerTo <# .SYNOPSIS - Configure Cortana button on the taskbar - - .PARAMETER Hide - Show Cortana button on the taskbar + Cortana button on the taskbar .PARAMETER Show Hide Cortana button on the taskbar + .PARAMETER Hide + Show Cortana button on the taskbar + .EXAMPLE CortanaButton -Hide @@ -1742,7 +1752,7 @@ function CortanaButton <# .SYNOPSIS - Configure sync provider notification within File Explorer + Sync provider notification in File Explorer .PARAMETER Hide Do not show sync provider notification within File Explorer @@ -1793,7 +1803,7 @@ function OneDriveFileExplorerAd <# .SYNOPSIS - Configure windows snapping + Windows snapping .PARAMETER Disable When I snap a window, do not show what I can snap next to it @@ -1844,7 +1854,7 @@ function SnapAssist <# .SYNOPSIS - Configure the file transfer dialog box mode + The file transfer dialog box mode .PARAMETER Detailed Show the file transfer dialog box in the detailed mode @@ -1903,7 +1913,7 @@ function FileTransferDialog <# .SYNOPSIS - Configure the File Explorer ribbon + The File Explorer ribbon .PARAMETER Expanded Expand the File Explorer ribbon @@ -1962,20 +1972,20 @@ function FileExplorerRibbon <# .SYNOPSIS - Configure the recycle bin files delete confirmation dialog - - .PARAMETER Disable - Display/do not display the recycle bin files delete confirmation dialog + The recycle bin files delete confirmation dialog .PARAMETER Enable - Display/do not display the recycle bin files delete confirmation dialog + Display the recycle bin files delete confirmation dialog - .EXAMPLE - RecycleBinDeleteConfirmation -Disable + .PARAMETER Disable + Do not display the recycle bin files delete confirmation dialog .EXAMPLE RecycleBinDeleteConfirmation -Enable + .EXAMPLE + RecycleBinDeleteConfirmation -Disable + .NOTES Current user #> @@ -1985,52 +1995,52 @@ function RecycleBinDeleteConfirmation ( [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" - { - $ShellState[4] = 55 - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState -PropertyType Binary -Value $ShellState -Force - } "Enable" { $ShellState[4] = 51 New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState -PropertyType Binary -Value $ShellState -Force } - } + "Disable" + { + $ShellState[4] = 55 + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState -PropertyType Binary -Value $ShellState -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 + The "3D Objects" folder in "This PC" and Quick access .PARAMETER Hide Hide the "3D Objects" folder in "This PC" and Quick access - .EXAMPLE - 3DObjects -Show + .PARAMETER Show + Show the "3D Objects" folder in "This PC" and Quick access .EXAMPLE 3DObjects -Hide + .EXAMPLE + 3DObjects -Show + .NOTES Current user #> @@ -2040,17 +2050,17 @@ function 3DObjects ( [Parameter( Mandatory = $true, - ParameterSetName = "Show" + ParameterSetName = "Hide" )] [switch] - $Show, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "Hide" + ParameterSetName = "Show" )] [switch] - $Hide + $Show ) switch ($PSCmdlet.ParameterSetName) @@ -2090,115 +2100,115 @@ function 3DObjects <# .SYNOPSIS - Configure frequently used folders in Quick access - - .PARAMETER Show - Show frequently used folders in Quick access + Recently used files in Quick access .PARAMETER Hide - Hide frequently used folders in Quick access + Hide recently used files in Quick access + + .PARAMETER Show + Show recently used files in Quick access .EXAMPLE - QuickAccessFrequentFolders -Show + QuickAccessRecentFiles -Hide .EXAMPLE - QuickAccessFrequentFolders -Hide + QuickAccessRecentFiles -Show .NOTES Current user #> -function QuickAccessFrequentFolders +function QuickAccessRecentFiles { 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 + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -PropertyType DWord -Value 0 -Force } "Show" { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -PropertyType DWord -Value 1 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -PropertyType DWord -Value 1 -Force } } } <# .SYNOPSIS - Configure recently used files in Quick access - - .PARAMETER Show - Show recently used files in Quick access + Frequently used folders in Quick access .PARAMETER Hide - Hide recently used files in Quick access + Hide frequently used folders in Quick access + + .PARAMETER Show + Show frequently used folders in Quick access .EXAMPLE - QuickAccessRecentFiles -Show + QuickAccessFrequentFolders -Hide .EXAMPLE - QuickAccessRecentFiles -Hide + QuickAccessFrequentFolders -Show .NOTES Current user #> -function QuickAccessRecentFiles +function QuickAccessFrequentFolders { 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 -Name ShowFrequent -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 -Name ShowFrequent -PropertyType DWord -Value 1 -Force } } } <# .SYNOPSIS - Configure Task View button on the taskbar + Task view button on the taskbar .PARAMETER Hide - Show Task View button on the taskbar + Hide the Task View button on the taskbar .PARAMETER Show - Do not show Task View button on the taskbar + Show the Task View button on the taskbar .EXAMPLE TaskViewButton -Hide @@ -2243,7 +2253,7 @@ function TaskViewButton <# .SYNOPSIS - Configure People button on the taskbar + People button on the taskbar .PARAMETER Hide Hide People button on the taskbar @@ -2302,7 +2312,7 @@ function PeopleTaskbar <# .SYNOPSIS - Configure seconds on the taskbar clock + Seconds on the taskbar clock .PARAMETER Hide Hide seconds on the taskbar clock @@ -2353,16 +2363,16 @@ function SecondsInSystemClock <# .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 @@ -2421,20 +2431,20 @@ function TaskbarSearch <# .SYNOPSIS - Configure the Windows Ink Workspace button on the taskbar - - .PARAMETER Show - Show the Windows Ink Workspace button on the taskbar + The Windows Ink Workspace button on the taskbar .PARAMETER Hide Hide the Windows Ink Workspace button on the taskbar - .EXAMPLE - WindowsInkWorkspace -Show + .PARAMETER Show + Show the Windows Ink Workspace button on the taskbar .EXAMPLE WindowsInkWorkspace -Hide + .EXAMPLE + WindowsInkWorkspace -Show + .NOTES Current user #> @@ -2472,7 +2482,7 @@ function WindowsInkWorkspace <# .SYNOPSIS - Configure icons in the notification area + Icons in the notification area .PARAMETER Show Always show all icons in the notification area @@ -2523,7 +2533,7 @@ function TrayIcons <# .SYNOPSIS - Configure the Meet Now icon in the notification area + The Meet Now icon in the notification area .PARAMETER Hide Hide the Meet Now icon in the notification area @@ -2596,19 +2606,19 @@ function MeetNow <# .SYNOPSIS - Configure "News and Interests" + News and Interests - .PARAMETER Show - Show "News and Interests" + .PARAMETER Disable + Disable "News and Interests" on the taskbar - .PARAMETER Hide - Hide "News and Interests" + .PARAMETER Enable + Enable "News and Interests" on the taskbar .EXAMPLE - NewsInterests -Show + NewsInterests -Disable .EXAMPLE - NewsInterests -Hide + NewsInterests -Enable .NOTES Current user @@ -2619,28 +2629,28 @@ function NewsInterests ( [Parameter( Mandatory = $true, - ParameterSetName = "Show" + ParameterSetName = "Disable" )] [switch] - $Show, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Hide" + ParameterSetName = "Enable" )] [switch] - $Hide + $Enable ) switch ($PSCmdlet.ParameterSetName) { - "Show" + "Disable" { - New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name ShellFeedsTaskbarViewMode -PropertyType DWord -Value 0 -Force + New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name ShellFeedsTaskbarViewMode -PropertyType DWord -Value 2 -Force } - "Hide" + "Enable" { - New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name ShellFeedsTaskbarViewMode -PropertyType DWord -Value 2 -Force + New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name ShellFeedsTaskbarViewMode -PropertyType DWord -Value 0 -Force } } } @@ -2744,16 +2754,16 @@ public static string GetString(uint strId) <# .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 @@ -2827,71 +2837,71 @@ 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" - { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -PropertyType DWord -Value 1 -Force - } "Dark" { New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -PropertyType DWord -Value 0 -Force } + "Light" + { + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -PropertyType DWord -Value 1 -Force + } } } <# .SYNOPSIS - Configure the default app mode color scheme - - .PARAMETER Light - Set the app mode color scheme to the light + The default app mode .PARAMETER Dark - Set the app mode color scheme to the dark + Set the default app mode dark - .EXAMPLE - AppMode -Light + .PARAMETER Light + Set the default app mode light .EXAMPLE AppMode -Dark + .EXAMPLE + AppMode -Light + .NOTES Current user #> @@ -2901,35 +2911,35 @@ function AppMode ( [Parameter( Mandatory = $true, - ParameterSetName = "Light" + ParameterSetName = "Dark" )] [switch] - $Light, + $Dark, [Parameter( Mandatory = $true, - ParameterSetName = "Dark" + ParameterSetName = "Light" )] [switch] - $Dark + $Light ) switch ($PSCmdlet.ParameterSetName) { - "Light" - { - New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -PropertyType DWord -Value 1 -Force - } "Dark" { New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -PropertyType DWord -Value 0 -Force } + "Light" + { + New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -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 @@ -2988,7 +2998,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 @@ -3039,7 +3049,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 @@ -3083,14 +3093,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 @@ -3164,22 +3174,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 { @@ -3187,35 +3197,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 @@ -3263,27 +3273,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 #> @@ -3293,47 +3303,47 @@ function PrtScnSnippingTool ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable + $Disable ) 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 } + "Disable" + { + New-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name PrintScreenKeyForSnippingEnabled -PropertyType DWord -Value 0 -Force + } } } <# .SYNOPSIS - Configure an input method for each app window + A different input method for each app window .PARAMETER Enable - Let use a different input method for each app window + Let me use a different input method for each app window .PARAMETER Disable - Do not let use a different input method for each app window + Do not use a different input method for each app window .EXAMPLE - AppsLanguageSwitch -Disable + AppsLanguageSwitch -Enable .EXAMPLE - AppsLanguageSwitch -Enable + AppsLanguageSwitch -Disable .NOTES Current user @@ -3344,17 +3354,17 @@ function AppsLanguageSwitch ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable + $Disable ) switch ($PSCmdlet.ParameterSetName) @@ -3374,7 +3384,7 @@ function AppsLanguageSwitch #region OneDrive <# .SYNOPSIS - Uninstall/install OneDrive + OneDrive .PARAMETER Uninstall Uninstall OneDrive @@ -3439,25 +3449,21 @@ function OneDrive Start-Process -FilePath $OneDriveSetup[0] -ArgumentList $OneDriveSetup[1..2] -Wait } - # Get the OneDrive user folder path and remove it if it doesn't contain any user filesS - $OneDriveUserFolder = Get-ItemPropertyValue -Path HKCU:\Environment -Name OneDrive - if ((Get-ChildItem -Path $OneDriveUserFolder -Force -ErrorAction Ignore | Measure-Object).Count -eq 0) - { - Remove-Item -Path $OneDriveUserFolder -Recurse -Force -ErrorAction Ignore - } - else + # Get the OneDrive user folder path and remove it if it doesn't contain any user files + if (Test-Path -Path $env:OneDrive) { - Invoke-Item -Path $OneDriveUserFolder - } - - # https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexa - # The system does not move the file until the operating system is restarted - # The system moves the file immediately after AUTOCHK is executed, but before creating any paging files - $Signature = @{ - Namespace = "WinAPI" - Name = "DeleteFiles" - Language = "CSharp" - MemberDefinition = @" + if ((Get-ChildItem -Path $env:OneDrive -ErrorAction Ignore | Measure-Object).Count -eq 0) + { + Remove-Item -Path $env:OneDrive -Recurse -Force -ErrorAction Ignore + + # https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexa + # The system does not move the file until the operating system is restarted + # The system moves the file immediately after AUTOCHK is executed, but before creating any paging files + $Signature = @{ + Namespace = "WinAPI" + Name = "DeleteFiles" + Language = "CSharp" + MemberDefinition = @" public enum MoveFileFlags { MOVEFILE_DELAY_UNTIL_REBOOT = 0x00000004 @@ -3471,24 +3477,31 @@ public static bool MarkFileDelete (string sourcefile) return MoveFileEx(sourcefile, null, MoveFileFlags.MOVEFILE_DELAY_UNTIL_REBOOT); } "@ - } + } - # If there are some files or folders left in $env:LOCALAPPDATA\Temp - if ((Get-ChildItem -Path $OneDriveUserFolder -Force -ErrorAction Ignore | Measure-Object).Count -ne 0) - { - if (-not ("WinAPI.DeleteFiles" -as [type])) - { - Add-Type @Signature - } + # If there are some files or folders left in %LOCALAPPDATA\Temp% + if ((Get-ChildItem -Path $env:OneDrive -ErrorAction Ignore | Measure-Object).Count -ne 0) + { + if (-not ("WinAPI.DeleteFiles" -as [type])) + { + Add-Type @Signature + } - try - { - Remove-Item -Path $OneDriveUserFolder -Recurse -Force -ErrorAction Stop + try + { + Remove-Item -Path $env:OneDrive -Recurse -Force -ErrorAction Stop + } + catch + { + # If files are in use remove them at the next boot + Get-ChildItem -Path $env:OneDrive -Recurse -Force | ForEach-Object -Process {[WinAPI.DeleteFiles]::MarkFileDelete($_.FullName)} + } + } } - catch + else { - # If files are in use remove them at the next boot - Get-ChildItem -Path $OneDriveUserFolder -Recurse -Force | ForEach-Object -Process {[WinAPI.DeleteFiles]::MarkFileDelete($_.FullName)} + # Invoke-Item doesn't work + Start-Process -FilePath explorer -ArgumentList $env:OneDrive } } @@ -3506,8 +3519,10 @@ public static bool MarkFileDelete (string sourcefile) Clear-Variable -Name OpenedFolders -Force -ErrorAction Ignore $OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke() - # Terminate File Explorer process - TASKKILL /F /IM explorer.exe + # Terminate the File Explorer process + New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoRestartShell -Value 0 -Force + Stop-Process -Name explorer -Force + New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoRestartShell -Value 1 -Force # Attempt to unregister FileSyncShell64.dll and remove $FileSyncShell64dlls = Get-ChildItem -Path "$OneDriveFolder\*\amd64\FileSyncShell64.dll" -Force @@ -3530,14 +3545,16 @@ public static bool MarkFileDelete (string sourcefile) Start-Sleep -Seconds 1 - # Restoring closed folders + # Start the File Explorer process Start-Process -FilePath explorer + # Restoring closed folders foreach ($OpenedFolder in $OpenedFolders) { if (Test-Path -Path $OpenedFolder) { - Invoke-Item -Path $OpenedFolder + # Invoke-Item doesn't work + Start-Process -FilePath explorer -ArgumentList $OpenedFolder } } @@ -3597,19 +3614,19 @@ public static bool MarkFileDelete (string sourcefile) #region StorageSense <# .SYNOPSIS - Configure Storage Sense + Storage Sense + + .PARAMETER Enable + Turn on Storage Sense .PARAMETER Disable Turn off Storage Sense - .PARAMETER Enable - Turn on off Storage Sense - .EXAMPLE - StorageSense -Disable + StorageSense -Enable .EXAMPLE - StorageSense -Enable + StorageSense -Disable .NOTES Current user @@ -3620,29 +3637,21 @@ function StorageSense ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable + $Disable ) switch ($PSCmdlet.ParameterSetName) { - "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 0 -Force - } "Enable" { if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy)) @@ -3651,69 +3660,20 @@ function StorageSense } New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01 -PropertyType DWord -Value 1 -Force } - } -} - -<# - .SYNOPSIS - Configure Storage Sense running - - .PARAMETER Month - Run Storage Sense every month - - .PARAMETER Default - Run Storage Sense during low free disk space - - .EXAMPLE - StorageSenseFrequency -Month - - .EXAMPLE - StorageSenseFrequency -Default - - .NOTES - Current user -#> -function StorageSenseFrequency -{ - param - ( - [Parameter( - Mandatory = $true, - ParameterSetName = "Month" - )] - [switch] - $Month, - - [Parameter( - Mandatory = $true, - ParameterSetName = "Default" - )] - [switch] - $Default - ) - - switch ($PSCmdlet.ParameterSetName) - { - "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 2048 -PropertyType DWord -Value 30 -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 @@ -3770,58 +3730,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 } } } @@ -3830,7 +3788,7 @@ function StorageSenseRecycleBin <# .SYNOPSIS - Configure hibernation + Hibernation .PARAMETER Disable Disable hibernation @@ -3846,6 +3804,8 @@ function StorageSenseRecycleBin .NOTES Do not recommend turning it off on laptops + + .NOTES Current user #> function Hibernate @@ -3854,35 +3814,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" @@ -4155,7 +4115,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 @@ -4178,17 +4138,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) @@ -4206,20 +4166,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 #> @@ -4244,32 +4204,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 @@ -4280,26 +4240,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 } @@ -4308,20 +4268,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 #> @@ -4346,20 +4306,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 @@ -4382,17 +4342,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) @@ -4411,20 +4371,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 #> @@ -4449,13 +4409,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) @@ -4467,18 +4420,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 @@ -4495,17 +4455,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) @@ -4523,7 +4483,7 @@ function WindowsManageDefaultPrinter <# .SYNOPSIS - Configure Windows features + Windows features .PARAMETER Disable Disable Windows features @@ -4539,6 +4499,8 @@ function WindowsManageDefaultPrinter .NOTES A pop-up dialog box lets a user select features + + .NOTES Current user #> function WindowsFeatures @@ -4547,17 +4509,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 @@ -4587,13 +4549,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 @@ -4846,7 +4803,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); <# .SYNOPSIS - Configure optional features + Optional features .PARAMETER Uninstall Uninstall optional features @@ -4862,6 +4819,8 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); .NOTES A pop-up dialog box lets a user select features + + .NOTES Current user #> function WindowsCapabilities @@ -4870,17 +4829,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 @@ -4915,13 +4874,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 @@ -5233,20 +5187,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 #> @@ -5271,6 +5225,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"}) @@ -5278,22 +5236,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 @@ -5303,6 +5257,8 @@ function UpdateMicrosoftProducts .NOTES It isn't recommended to turn on the "High performance" power plan on laptops + + .NOTES Current user #> function PowerPlan @@ -5339,19 +5295,19 @@ 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 + + .PARAMETER Disable + Do not use the latest installed .NET runtime for all apps .EXAMPLE - LatestInstalled.NET -Disable + LatestInstalled.NET -Enable .EXAMPLE - LatestInstalled.NET -Enable + LatestInstalled.NET -Disable .NOTES Machine-wide @@ -5362,37 +5318,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 @@ -5401,10 +5357,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 @@ -5412,7 +5368,7 @@ function LatestInstalled.NET .NOTES Current user #> -function PCTurnOffDevice +function NetworkAdaptersSavePower { param ( @@ -5456,24 +5412,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 ( @@ -5500,14 +5456,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 @@ -5529,6 +5485,8 @@ function SetInputMethod .NOTES User files or folders won't me moved to a new location + + .NOTES Current user #> function SetUserShellFolderLocation @@ -5699,12 +5657,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 @@ -5716,7 +5674,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 @@ -6013,7 +5971,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 @@ -6049,7 +6007,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 @@ -6085,7 +6043,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 @@ -6121,7 +6079,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 @@ -6157,7 +6115,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 @@ -6193,7 +6151,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 @@ -6369,7 +6327,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 @@ -6414,7 +6372,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 } } @@ -6439,13 +6397,13 @@ function WinPrtScrFolder <# .SYNOPSIS - Configure recommended troubleshooting + Recommended troubleshooter preferences .PARAMETER Automatic - Run troubleshooters automatically, then notify + Run troubleshooter automatically, then notify me .PARAMETER Default - Ask me before running troubleshooters + Ask me before running troubleshooter .EXAMPLE RecommendedTroubleshooting -Automatic @@ -6454,8 +6412,10 @@ function WinPrtScrFolder RecommendedTroubleshooting -Default .NOTES - Machine-wide In order this feature to work the OS level of diagnostic data gathering will be set to "Optional diagnostic data" and the error reporting feature will be turned on + + .NOTES + Machine-wide #> function RecommendedTroubleshooting { @@ -6504,7 +6464,7 @@ function RecommendedTroubleshooting # Turn on Windows Error Reporting 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 @@ -6512,10 +6472,10 @@ function RecommendedTroubleshooting <# .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 @@ -6563,20 +6523,20 @@ function FoldersLaunchSeparateProcess <# .SYNOPSIS - Configure reserved storage after the next update installation - - .PARAMETER Enable - Enable reserved storage after the next update installation + Reserved storage .PARAMETER Disable Disable and delete reserved storage after the next update installation - .EXAMPLE - ReservedStorage -Enable + .PARAMETER Enable + Enable reserved storage after the next update installation .EXAMPLE ReservedStorage -Disable + .EXAMPLE + ReservedStorage -Enable + .NOTES Current user #> @@ -6586,25 +6546,21 @@ function ReservedStorage ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable, + $Disable, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable + $Enable ) switch ($PSCmdlet.ParameterSetName) { - "Enable" - { - Set-WindowsReservedStorageState -State Enabled - } "Disable" { try @@ -6616,25 +6572,29 @@ function ReservedStorage Write-Error -Message $Localization.ReservedStorageIsInUse -ErrorAction SilentlyContinue } } + "Enable" + { + Set-WindowsReservedStorageState -State Enabled + } } } <# .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 #> @@ -6644,25 +6604,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")) @@ -6671,12 +6627,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 @@ -6727,20 +6687,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 #> @@ -6750,48 +6710,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 #> @@ -6801,48 +6761,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 #> @@ -6852,48 +6812,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 #> @@ -6903,41 +6863,41 @@ 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 restartable apps when signing out and restart them after signing in + Restart apps after signing in .PARAMETER Enable - Enable automatically saving my restartable apps when signing out and restart them after signing in + Automatically saving my restartable apps when signing out and restart them after signing in .PARAMETER Disable - Disable automatically saving my restartable apps when signing out and restart them after signing in + Turn off automatically saving my restartable apps when signing out and restart them after signing in .EXAMPLE SaveRestartableApps -Enable @@ -6982,7 +6942,7 @@ function SaveRestartableApps <# .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 @@ -7052,64 +7012,64 @@ 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 - Configure restarting this device as soon as possible when a restart is required to install an update + Restart this device as soon as possible when a restart is required to install an update .PARAMETER Enable - Enable restarting this device as soon as possible when a restart is required to install an update + Restart this device as soon as possible when a restart is required to install an update .PARAMETER Disable - Disable restarting this device as soon as possible when a restart is required to install an update + Don't restarting this device as soon as possible when a restart is required to install an update .EXAMPLE DeviceRestartAfterUpdate -Enable @@ -7120,7 +7080,7 @@ function SmartActiveHours .NOTES Machine-wide #> -function DeviceRestartAfterUpdate +function RestartDeviceAfterUpdate { param ( @@ -7154,16 +7114,16 @@ function DeviceRestartAfterUpdate <# .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" @@ -7517,9 +7477,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 + } } } } @@ -7795,19 +7765,19 @@ public static void Refresh() #region WSL <# .SYNOPSIS - Configure Windows Subsystem for Linux (WSL) + Windows Subsystem for Linux (WSL) - .PARAMETER Enable + .PARAMETER Install Install the Windows Subsystem for Linux (WSL) - .PARAMETER Disable + .PARAMETER Uninstall Uninstall the Windows Subsystem for Linux (WSL) .EXAMPLE - WSL -Enable + WSL -Install .EXAMPLE - WSL -Disable + WSL -Uninstall .NOTES Machine-wide @@ -7818,17 +7788,17 @@ function WSL ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Install" )] [switch] - $Enable, + $Install, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Uninstall" )] [switch] - $Disable + $Uninstall ) $WSLFeatures = @( @@ -7841,7 +7811,7 @@ function WSL switch ($PSCmdlet.ParameterSetName) { - "Enable" + "Install" { Enable-WindowsOptionalFeature -Online -FeatureName $WSLFeatures -NoRestart @@ -7863,9 +7833,11 @@ function WSL .SYNOPSIS Download, install the Linux kernel update package and set WSL 2 as the default version when installing a new Linux distribution + .NOTES + To receive kernel updates, enable the Windows Update setting: "Receive updates for other Microsoft products" + .NOTES Machine-wide - To receive kernel updates, enable the Windows Update setting: "Receive updates for other Microsoft products when you update Windows" #> function EnableWSL2 { @@ -7926,7 +7898,7 @@ function EnableWSL2 #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 @@ -7974,14 +7946,14 @@ function RecentlyAddedApps } "Show" { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Force -ErrorAction Ignore } } } <# .SYNOPSIS - Configure app suggestions in the Start menu + App suggestions in the Start menu .PARAMETER Hide Hide app suggestions in the Start menu @@ -8032,7 +8004,7 @@ function AppSuggestions <# .SYNOPSIS - Configure how to run the Windows PowerShell shortcut + How to run the Windows PowerShell shortcut .PARAMETER Elevated Run the Windows PowerShell shortcut from the Start menu as Administrator @@ -8087,7 +8059,7 @@ function RunPowerShellShortcut <# .SYNOPSIS - Configure the Start tiles + The Start tiles .PARAMETER ControlPanel Pin the "Control Panel" shortcut to Start @@ -8201,10 +8173,10 @@ public static string GetString(uint strId) if (((Get-Command -Name PinToStart).Parametersets.Parameters | Where-Object -FilterScript {$null -eq $_.Attributes.AliasNames}).Attributes.ValidValues | Where-Object -FilterScript {$_ -match "DevicesPrinters"}) { # Create the old-style "Devices and Printers" shortcut in the Start menu - $Shell = New-Object -ComObject Wscript.Shell - $Shortcut = $Shell.CreateShortcut("$env:APPDATA\Microsoft\Windows\Start menu\Programs\System Tools\$DevicesPrinters.lnk") - $Shortcut.TargetPath = "control" - $Shortcut.Arguments = "printers" + $Shell = New-Object -ComObject Wscript.Shell + $Shortcut = $Shell.CreateShortcut("$env:APPDATA\Microsoft\Windows\Start menu\Programs\System Tools\$DevicesPrinters.lnk") + $Shortcut.TargetPath = "control" + $Shortcut.Arguments = "printers" $Shortcut.IconLocation = "$env:SystemRoot\system32\DeviceCenter.dll" $Shortcut.Save() @@ -8218,16 +8190,16 @@ public static string GetString(uint strId) # Control Panel hash table @{ # Special name for Control Panel - Name = "ControlPanel" - Size = "2x2" + Name = "ControlPanel" + Size = "2x2" Column = 0 - Row = 0 - AppID = "Microsoft.Windows.ControlPanel" + Row = 0 + AppID = "Microsoft.Windows.ControlPanel" }, # "Devices & Printers" hash table @{ # Special name for "Devices & Printers" - Name = "DevicesPrinters" + Name = "DevicesPrinters" Size = "2x2" Column = 2 Row = 0 @@ -8236,11 +8208,11 @@ public static string GetString(uint strId) # Windows PowerShell hash table @{ # Special name for Windows PowerShell - Name = "PowerShell" - Size = "2x2" + Name = "PowerShell" + Size = "2x2" Column = 4 - Row = 0 - AppID = "{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\WindowsPowerShell\v1.0\powershell.exe" + Row = 0 + AppID = "{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\WindowsPowerShell\v1.0\powershell.exe" } ) @@ -8345,8 +8317,8 @@ public static string GetString(uint strId) { New-Item -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Force } - New-ItemProperty -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name LockedStartLayout -Value 1 -Force - New-ItemProperty -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name StartLayoutFile -Value $Script:StartLayout -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name LockedStartLayout -PropertyType DWord -Value 1 -Force + New-ItemProperty -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name StartLayoutFile -PropertyType ExpandString -Value $Script:StartLayout -Force Start-Sleep -Seconds 3 @@ -8384,7 +8356,7 @@ public static string GetString(uint strId) Uninstall UWP apps .PARAMETER ForAllUsers - Set the "For All Users" checkbox to unistall packages for all users + The "ForAllUsers" argument sets a checkbox to unistall packages for all users .EXAMPLE UninstallUWPApps @@ -8393,16 +8365,13 @@ public static string GetString(uint strId) UninstallUWPApps -ForAllUsers .NOTES - Load The WinRT.Runtime.dll and Microsoft.Windows.SDK.NET.dll assemblies to the current session in order to get localized UWP apps names - CsWinRT v1.2.6 - Microsoft.Windows.SDK.NET 10.0.19041.17 + Load the WinRT.Runtime.dll and Microsoft.Windows.SDK.NET.dll assemblies in the current session in order to get localized UWP apps names .LINK https://github.com/microsoft/CsWinRT https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref .NOTES - A pop-up dialog box lets a user select packages Current user #> function UninstallUWPApps @@ -8812,7 +8781,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) @@ -8833,6 +8802,8 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); $ButtonUninstall.IsEnabled = $true } + # Force move the WPF form to the foreground + $Window.Add_Loaded({$Window.Activate()}) $Form.ShowDialog() | Out-Null } } @@ -8847,17 +8818,14 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); .NOTES UWP apps can be restored only if they were uninstalled for the current user - .NOTES - Load The WinRT.Runtime.dll and Microsoft.Windows.SDK.NET.dll assemblies to the current session in order to get localized UWP apps names - CsWinRT v1.2.6 - Microsoft.Windows.SDK.NET 10.0.19041.17 - .LINK https://github.com/microsoft/CsWinRT https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref .NOTES - A pop-up dialog box lets a user select packages + Load the WinRT.Runtime.dll and Microsoft.Windows.SDK.NET.dll assemblies in the current session in order to get localized UWP apps names + + .NOTES Current user #> function RestoreUWPApps @@ -9113,6 +9081,7 @@ function RestoreUWPApps { Write-Verbose -Message $Localization.DialogBoxOpening -Verbose + #region Sendkey function # Emulate the Backspace key sending to prevent the console window to freeze Start-Sleep -Milliseconds 500 @@ -9137,7 +9106,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) @@ -9151,6 +9120,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); # Emulate the Backspace key sending to prevent the console window to freeze [System.Windows.Forms.SendKeys]::SendWait("{BACKSPACE 1}") } + #endregion Sendkey function if ($PackagesToRestore.Count -gt 0) { @@ -9167,24 +9137,28 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); .SYNOPSIS Install "HEVC Video Extensions from Device Manufacturer" to be able to open .heic and .heif formats - .PARAMETER Manual - Open Microsoft Store "HEVC Video Extensions from Device Manufacturer" page to install the extension manually - .PARAMETER Install Download and install the "HEVC Video Extensions from Device Manufacturer" extension using the https://store.rg-adguard.net parser - .EXAMPLE - HEIF -Manual + .PARAMETER Manually + Open Microsoft Store "HEVC Video Extensions from Device Manufacturer" page to install the extension manually .EXAMPLE HEIF -Install + .EXAMPLE + HEIF -Manually + .LINK https://www.microsoft.com/store/productId/9n4wgh0z6vhq + + .LINK https://dev.to/kaiwalter/download-windows-store-apps-with-powershell-from-https-store-rg-adguard-net-155m .NOTES The extension can be installed without Microsoft account + + .NOTES Current user #> function HEIF @@ -9193,40 +9167,21 @@ function HEIF ( [Parameter( Mandatory = $true, - ParameterSetName = "Manual" + ParameterSetName = "Install" )] [switch] - $Manual, + $Install, [Parameter( Mandatory = $true, - ParameterSetName = "Install" + ParameterSetName = "Manually" )] [switch] - $Install + $Manually ) switch ($PSCmdlet.ParameterSetName) { - "Manual" - { - if (-not (Get-AppxPackage -Name Microsoft.HEVCVideoExtension) -and (Get-AppxPackage -Name Microsoft.Windows.Photos)) - { - try - { - if ((Invoke-WebRequest -Uri https://www.google.com -UseBasicParsing -DisableKeepAlive -Method Head).StatusDescription) - { - Start-Process -FilePath ms-windows-store://pdp/?ProductId=9n4wgh0z6vhq - } - } - catch [System.Net.WebException] - { - Write-Warning -Message $Localization.NoInternetConnection - Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue - return - } - } - } "Install" { # Check whether the extension is already installed @@ -9296,12 +9251,31 @@ function HEIF } } } - } -} - -<# + "Manually" + { + if ((-not (Get-AppxPackage -Name Microsoft.HEVCVideoExtension)) -and (Get-AppxPackage -Name Microsoft.Windows.Photos)) + { + try + { + if ((Invoke-WebRequest -Uri https://www.google.com -UseBasicParsing -DisableKeepAlive -Method Head).StatusDescription) + { + Start-Process -FilePath ms-windows-store://pdp/?ProductId=9n4wgh0z6vhq + } + } + catch [System.Net.WebException] + { + Write-Warning -Message $Localization.NoInternetConnection + Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue + return + } + } + } + } +} + +<# .SYNOPSIS - Configure Cortana autostarting + Cortana autostarting .PARAMETER Disable Enable Cortana autostarting @@ -9354,7 +9328,11 @@ function CortanaAutostart { if (Get-AppxPackage -Name Microsoft.549981C3F5F10) { - Remove-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\Microsoft.549981C3F5F10_8wekyb3d8bbwe\CortanaStartupId" -Name State -Force -ErrorAction SilentlyContinue + if (-not (Test-Path -Path "Registry::HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\Microsoft.549981C3F5F10_8wekyb3d8bbwe\CortanaStartupId")) + { + New-Item -Path "Registry::HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\Microsoft.549981C3F5F10_8wekyb3d8bbwe\CortanaStartupId" -Force + } + New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\Microsoft.549981C3F5F10_8wekyb3d8bbwe\CortanaStartupId" -Name State -PropertyType DWord -Value 2 -Force } } } @@ -9362,7 +9340,7 @@ function CortanaAutostart <# .SYNOPSIS - Configure UWP apps running in the background + How UWP runs in the background .PARAMETER Disable Do not let UWP apps run in the background @@ -9466,7 +9444,7 @@ function CheckUWPAppsUpdates #region Gaming <# .SYNOPSIS - Configure Xbox Game Bar + Xbox Game Bar .PARAMETER Disable Disable Xbox Game Bar @@ -9525,7 +9503,7 @@ function XboxGameBar <# .SYNOPSIS - Configure Xbox Game Bar tips + Xbox Game Bar tips .PARAMETER Disable Disable Xbox Game Bar tips @@ -9582,15 +9560,20 @@ function XboxGameTips <# .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 @@ -9638,24 +9621,26 @@ function SetAppGraphicsPerformance <# .SYNOPSIS - Configure hardware-accelerated GPU scheduling - - .PARAMETER Disable - Disable hardware-accelerated GPU scheduling + Hardware-accelerated GPU scheduling .PARAMETER Enable Enable hardware-accelerated GPU scheduling - .EXAMPLE - GPUScheduling -Disable + .PARAMETER Disable + Disable hardware-accelerated GPU scheduling .EXAMPLE GPUScheduling -Enable + .EXAMPLE + GPUScheduling -Disable + .NOTES Only with a dedicated GPU and WDDM verion is 2.7 or higher - Current user Restart needed + + .NOTES + Current user #> function GPUScheduling { @@ -9663,28 +9648,24 @@ function GPUScheduling ( [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Enable" )] [switch] - $Disable, + $Enable, [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Disable" )] [switch] - $Enable + $Disable ) switch ($PSCmdlet.ParameterSetName) { - "Disable" - { - New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 1 -Force - } "Enable" { - if ((Get-CimInstance -ClassName CIM_VideoController | Where-Object -FilterScript {$_.AdapterDACType -ne "Internal"})) + if (Get-CimInstance -ClassName CIM_VideoController | Where-Object -FilterScript {($_.AdapterDACType -ne "Internal") -and ($null -ne $_.AdapterDACType)}) { # Determining whether an OS is not installed on a virtual machine if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual") @@ -9698,6 +9679,10 @@ function GPUScheduling } } } + "Disable" + { + New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 1 -Force + } } } #endregion Gaming @@ -9722,6 +9707,8 @@ function GPUScheduling .NOTES A native interactive toast notification pops up every 30 days The task runs every 30 days + + .NOTES Current user #> function CleanupTask @@ -9982,6 +9969,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 @@ -10085,6 +10074,8 @@ Get-ChildItem -Path `$env:SystemRoot\SoftwareDistribution\Download -Recurse -For .NOTES The task runs every 60 days + + .NOTES Current user #> function TempTask @@ -10164,234 +10155,23 @@ Get-ChildItem -Path `$env:TEMP -Recurse -Force | Where-Object {`$_.CreationTime #endregion Scheduled tasks #region Microsoft 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 Microsoft Defender scanning -function AddDefenderExclusionFolder -{ - $Title = "Microsoft 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 Microsoft 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 Microsoft Defender scanning -function AddDefenderExclusionFile -{ - $Title = "Microsoft 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 Microsoft 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 Microsoft Defender Exploit Guard network protection + Microsoft Defender Exploit Guard network protection + + .PARAMETER Enable + Enable Microsoft Defender Exploit Guard network protection .PARAMETER Disable Disable Microsoft Defender Exploit Guard network protection - .PARAMETER Enable - Enable Microsoft Defender Exploit Guard network protection + .EXAMPLE + NetworkProtection -Enable .EXAMPLE NetworkProtection -Disable - .EXAMPLE - NetworkProtection -Enable + .NOTES Current user #> function NetworkProtection @@ -10400,47 +10180,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 @@ -10449,50 +10231,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 Microsoft Defender - - .PARAMETER Disable - Disable sandboxing for Microsoft Defender + Sandboxing for Microsoft Defender .PARAMETER Enable Enable sandboxing for Microsoft Defender - .EXAMPLE - DefenderSandbox -Disable + .PARAMETER Disable + Disable sandboxing for Microsoft Defender .EXAMPLE DefenderSandbox -Enable + .EXAMPLE + DefenderSandbox -Disable + .NOTES There is a bug in KVM with QEMU: enabling this function causes VM to freeze up during the loading phase of Windows + + .NOTES Current user #> function DefenderSandbox @@ -10501,29 +10285,29 @@ 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 + } } } @@ -10541,20 +10325,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 #> @@ -10564,107 +10348,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 @@ -10675,28 +10459,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 @@ -10727,27 +10507,31 @@ 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 UTF8BOM -Force + 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 #> @@ -10757,26 +10541,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)) @@ -10786,25 +10565,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 #> @@ -10814,25 +10598,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)) @@ -10841,18 +10621,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 @@ -10897,13 +10681,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 @@ -10945,14 +10729,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 @@ -11003,14 +10787,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 @@ -11107,19 +10891,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 @@ -11130,26 +10914,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)) { @@ -11160,28 +10940,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 @@ -11192,34 +10973,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 @@ -11229,24 +10999,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 @@ -11257,41 +11032,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 @@ -11333,14 +11108,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 @@ -11388,20 +11163,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 @@ -11435,18 +11210,24 @@ function EditWithPaint3DContext { "Hide" { - $Extensions = @(".bmp", ".gif", ".jpe", ".jpeg", ".jpg", ".png", ".tif", ".tiff") - foreach ($extension in $extensions) + if (Get-AppxPackage -Name Microsoft.MSPaint) { - New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\$Extension\Shell\3D Edit" -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force + $Extensions = @(".bmp", ".gif", ".jpe", ".jpeg", ".jpg", ".png", ".tif", ".tiff") + foreach ($Extension in $Extensions) + { + New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\$Extension\Shell\3D Edit" -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force + } } } "Show" { - $Extensions = @(".bmp", ".gif", ".jpe", ".jpeg", ".jpg", ".png", ".tif", ".tiff") - foreach ($Extension in $Extensions) + if (Get-AppxPackage -Name Microsoft.MSPaint) { - Remove-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\$Extension\Shell\3D Edit" -Name ProgrammaticAccessOnly -Force -ErrorAction SilentlyContinue + $Extensions = @(".bmp", ".gif", ".jpe", ".jpeg", ".jpg", ".png", ".tif", ".tiff") + foreach ($Extension in $Extensions) + { + Remove-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\$Extension\Shell\3D Edit" -Name ProgrammaticAccessOnly -Force -ErrorAction SilentlyContinue + } } } } @@ -11454,13 +11235,13 @@ function EditWithPaint3DContext <# .SYNOPSIS - Configure the "Edit with Photos" item in the context menu + The "Edit with Photos" item in the media files context menu .PARAMETER Hide - Hide the "Edit with Photos" item from the context menu + Hide the "Edit with Photos" item from the media files context menu .PARAMETER Show - Show the "Edit with Photos" item in the context menu + Show the "Edit with Photos" item in the media files context menu .EXAMPLE EditWithPhotosContext -Hide @@ -11503,7 +11284,7 @@ function EditWithPhotosContext { if (Get-AppxPackage -Name Microsoft.Windows.Photos) { - Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AppX43hnxtbyyps62jhe9sqpdzxn1790zetc\Shell\ShellEdit -Name ProgrammaticAccessOnly -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AppX43hnxtbyyps62jhe9sqpdzxn1790zetc\Shell\ShellEdit -Name ProgrammaticAccessOnly -Force -ErrorAction Ignore } } } @@ -11511,13 +11292,13 @@ function EditWithPhotosContext <# .SYNOPSIS - Configure the "Create a new video" item in the context menu + The "Create a new video" item in the media files context menu .PARAMETER Hide - Hide the "Create a new video" item from the context menu + Hide the "Create a new video" item from the media files context menu .PARAMETER Show - Show the "Create a new video" item in the context menu + Show the "Create a new video" item in the media files context menu .EXAMPLE CreateANewVideoContext -Hide @@ -11560,7 +11341,7 @@ function CreateANewVideoContext { if (Get-AppxPackage -Name Microsoft.Windows.Photos) { - Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AppX43hnxtbyyps62jhe9sqpdzxn1790zetc\Shell\ShellCreateVideo -Name ProgrammaticAccessOnly -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AppX43hnxtbyyps62jhe9sqpdzxn1790zetc\Shell\ShellCreateVideo -Name ProgrammaticAccessOnly -Force -ErrorAction Ignore } } } @@ -11568,13 +11349,13 @@ function CreateANewVideoContext <# .SYNOPSIS - Configure the "Edit" item in the images context menu + The "Edit" item in the images context menu .PARAMETER Hide Hide the "Edit" item from the images context menu .PARAMETER Show - Show the "Edit" item from the images context menu + Show the "Edit" item in the images context menu .EXAMPLE ImagesEditContext -Hide @@ -11617,7 +11398,7 @@ function ImagesEditContext { if ((Get-WindowsCapability -Online -Name "Microsoft.Windows.MSPaint*").State -eq "Installed") { - Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\edit -Name ProgrammaticAccessOnly -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\edit -Name ProgrammaticAccessOnly -Force -ErrorAction Ignore } } } @@ -11625,7 +11406,7 @@ function ImagesEditContext <# .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 @@ -11670,21 +11451,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 @@ -11718,18 +11499,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 @@ -11780,13 +11561,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 @@ -11820,26 +11601,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 } } } @@ -11847,19 +11621,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 @@ -11870,29 +11644,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") { @@ -11925,19 +11699,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 @@ -11948,29 +11722,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") { @@ -12003,19 +11777,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 @@ -12026,26 +11800,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)) { @@ -12059,13 +11833,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 @@ -12103,14 +11877,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 @@ -12158,58 +11932,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 } } } @@ -12287,9 +12010,7 @@ public static void PostMessage() <# .NOTES - Load The WinRT.Runtime.dll and Microsoft.Windows.SDK.NET.dll assemblies to the current session in order to get localized UWP apps names - CsWinRT v1.2.6 - Microsoft.Windows.SDK.NET 10.0.19041.17 + Load the WinRT.Runtime.dll and Microsoft.Windows.SDK.NET.dll assemblies in the current session in order to get localized UWP apps names .LINK https://github.com/microsoft/CsWinRT diff --git a/Sophia/PowerShell 7/Sophia.ps1 b/Sophia/PowerShell 7/Sophia.ps1 index d9d56fbb..5914b966 100644 --- a/Sophia/PowerShell 7/Sophia.ps1 +++ b/Sophia/PowerShell 7/Sophia.ps1 @@ -2,8 +2,8 @@ .SYNOPSIS Default preset file for "Windows 10 Sophia Script" - Version: v5.10.8 - Date: 20.06.2021 + Version: v5.11 + 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 v5.10.8 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & Inestic, 2014–2021" +$Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script v5.11 | 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,22 +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 - # Hide the Windows welcome experiences after updates and occasionally when I sign in to highlight what's new and suggested # Скрывать экран приветствия Windows после обновлений и иногда при входе, чтобы сообщить о новых функциях и предложениях WindowsWelcomeExperience -Hide @@ -218,15 +210,15 @@ WindowsTips -Enable # Не получать советы, подсказки и рекомендации при использованию Windows # WindowsTips -Disable -# Hide the suggested content in the Settings app +# Hide from me suggested content in the Settings app # Скрывать рекомендуемое содержимое в приложении "Параметры" SettingsSuggestedContent -Hide -# Show the suggested content in the Settings app (default value) +# Show me suggested content in the Settings app (default value) # Показывать рекомендуемое содержимое в приложении "Параметры" (значение по умолчанию) # SettingsSuggestedContent -Show -# Turn off the automatic installing suggested apps +# Turn off automatic installing suggested apps # Отключить автоматическую установку рекомендованных приложений AppsSilentInstalling -Disable @@ -268,11 +260,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 @@ -292,7 +284,7 @@ FileExtensions -Show # Скрывать расширения имён файлов файлов (значение по умолчанию) # FileExtensions -Hide -# Do not hide folder merge conflicts +# Show folder merge conflicts # Не скрывать конфликт слияния папок MergeConflicts -Show @@ -300,12 +292,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 # Hide Cortana button on the taskbar @@ -364,6 +356,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 @@ -372,19 +372,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 @@ -416,8 +408,8 @@ TaskbarSearch -Hide # Показать поле поиска на панели задач (значение по умолчанию) # TaskbarSearch -SearchBox -# Do not show the Windows Ink Workspace button on the taskbar -# Не показывать кнопку Windows Ink Workspace на панели задач +# Hide the Windows Ink Workspace button on the taskbar +# Скрыть кнопку Windows Ink Workspace на панели задач WindowsInkWorkspace -Hide # Show Windows Ink Workspace button on the taskbar (default value) @@ -428,60 +420,60 @@ WindowsInkWorkspace -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 # Hide the Meet Now icon in the notification area # Скрыть иконку "Провести собрание" в области уведомлений MeetNow -Hide -# Show the Meet Now icon in the notification area -# Отображать иконку "Провести собрание" в области уведомлений +# Show the Meet Now icon in the notification area (default value) +# Отображать иконку "Провести собрание" в области уведомлений (значение по умолчанию) # MeetNow -Show -# Hide "News and Interests" on the taskbar -# Скрыть "Новости и интересы" на панели задач -NewsInterests -Hide +# Disable "News and Interests" on the taskbar +# Отключить "Новости и интересы" на панели задач +NewsInterests -Disable -# Show "News and Interests" on the taskbar (default value) -# Отображать "Новости и интересы" на панели задач (значение по умолчанию) -# NewsInterests -Show +# Enable "News and Interests" on the taskbar (default value) +# Включить "Новости и интересы" на панели задач (значение по умолчанию) +# NewsInterests -Enable # Unpin the "Microsoft Edge", "Microsoft Store", or "Mail" shortcuts from the taskbar # Открепить ярлыки "Microsoft Edge", "Microsoft Store" или "Почта" от панели задач UnpinTaskbarShortcuts -Shortcuts Edge, Store, Mail -# 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 -# Set the app mode color scheme to the dark -# Установить цвет режима приложений на темный +# Set the default app mode to dark +# Установить цвет режима приложения на темный AppMode -Dark -# Set the app mode color scheme to the light -# Установить цвет режима приложений на светлый +# Set the default app mode to light (default value) +# Установить цвет режима приложения на светлый (значение по умолчанию) # AppMode -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) @@ -504,11 +496,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 @@ -528,11 +520,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 @@ -540,8 +532,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 @@ -565,14 +557,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 @@ -581,17 +565,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) @@ -600,7 +584,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" (значение по умолчанию) @@ -624,11 +608,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 # Включить доступ к сетевым дискам при включенном режиме одобрения администратором при доступе из программ, запущенных с повышенными правами @@ -654,20 +638,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 @@ -677,10 +661,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 @@ -697,7 +681,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 Установить схему управления питанием на "Высокая производительность" @@ -705,64 +689,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 @@ -775,7 +759,7 @@ WinPrtScrFolder -Desktop # WinPrtScrFolder -Default <# - Run troubleshooters automatically, then notify + Run troubleshooter automatically, then notify me In order this feature to work the OS level of diagnostic data gathering will be set to "Optional diagnostic data", and the error reporting feature will be turned on Автоматически запускать средства устранения неполадок, а затем уведомлять @@ -784,7 +768,7 @@ WinPrtScrFolder -Desktop RecommendedTroubleshooting -Automatic <# - Ask me before running troubleshooters (default value) + Ask me before running troubleshooter (default value) In order this feature to work the OS level of diagnostic data gathering will be set to "Optional diagnostic data" Спрашивать перед запуском средств устранения неполадок (значение по умолчанию) @@ -808,11 +792,11 @@ ReservedStorage -Disable # Включить зарезервированное хранилище (значение по умолчанию) # ReservedStorage -Enable -# 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 @@ -832,20 +816,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 @@ -856,11 +840,11 @@ ThumbnailCacheRemoval -Disable # Включить удаление кэша миниатюр (значение по умолчанию) # ThumbnailCacheRemoval -Enable -# Enable automatically saving my restartable apps when signing out and restart them after signing in -# Включить автоматическое сохранение моих перезапускаемых приложений при выходе из системы и перезапускать их после выхода +# Automatically saving my restartable apps when signing out and restart them after signing in +# Автоматически сохранять моих перезапускаемые приложения при выходе из системы и перезапускать их после выхода SaveRestartableApps -Enable -# Disable automatically saving my restartable apps when signing out and restart them after signing in (default value) +# Turn off automatically saving my restartable apps when signing out and restart them after signing in (default value) # Выключить автоматическое сохранение моих перезапускаемых приложений при выходе из системы и перезапускать их после выхода (значение по умолчанию) # SaveRestartableApps -Disable @@ -874,23 +858,23 @@ 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 # Restart this device as soon as possible when a restart is required to install an update # Перезапускать это устройство как можно быстрее, если для установки обновления требуется перезагрузка -DeviceRestartAfterUpdate -Enable +RestartDeviceAfterUpdate -Enable # Do not restart this device as soon as possible when a restart is required to install an update (default value) # Не перезапускать это устройство как можно быстрее, если для установки обновления требуется перезагрузка (значение по умолчанию) -# DeviceRestartAfterUpdate -Disable +# RestartDeviceAfterUpdate -Disable <# - 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" @@ -899,24 +883,13 @@ DeviceRestartAfterUpdate -Enable #endregion System #region WSL -# Install the Windows Subsystem for Linux (WSL) +# Install the Windows Subsystem for Linux (WSL) ### # Установить подсистему Windows для Linux (WSL) # WSL -Enable # Uninstall the Windows Subsystem for Linux (WSL) # Удалить подсистему Windows для Linux (WSL) # WSL -Disable - -<# - Download and install the Linux kernel update package - Set WSL 2 as the default version when installing a new Linux distribution - Run the function only after WSL installed and PC restart - - Скачать и установить пакет обновления ядра Linux - Установить WSL 2 как версию по умолчанию при установке нового дистрибутива Linux - Выполните функцию только после установки WSL и перезагрузка ПК -#> -# EnableWSL2 #endregion WSL #region Start menu @@ -966,23 +939,14 @@ PinToStart -Tiles ControlPanel, DevicesPrinters, PowerShell <# Uninstall UWP apps using the pop-up dialog box If the "For All Users" is checked apps packages will not be installed for new users + The "ForAllUsers" argument sets a checkbox to unistall packages for all users Удалить UWP-приложения, используя всплывающее диалоговое окно Пакеты приложений не будут установлены для новых пользователей, если отмечена галочка "Для всех пользователей" + Аргумент "ForAllUsers" устанавливает галочку для удаления пакетов для всех пользователей #> UninstallUWPApps -<# - Uninstall UWP apps using the pop-up dialog box - If the "For All Users" is checked apps packages will not be installed for new users - The "For All Users" checkbox checked by default - - Удалить UWP-приложения, используя всплывающее диалоговое окно - Пакеты приложений не будут установлены для новых пользователей, если отмечена галочка "Для всех пользователей" - Галочка "Для всех пользователей" отмечена по умолчанию -#> -# UninstallUWPApps -ForAllUsers - <# Restore the default UWP apps using the pop-up dialog box UWP apps can be restored only if they were uninstalled only for the current user @@ -992,19 +956,19 @@ UninstallUWPApps #> # RestoreUWPApps +# Download and install "HEVC Video Extensions from Device Manufacturer" to be able to open .heic and .heif formats +# Скачать и установить "Расширения для видео HEVC от производителя устройства", чтобы иметь возможность открывать форматы .heic и .heif +HEIF -Install + <# Open Microsoft Store "HEVC Video Extensions from Device Manufacturer" page to install this extension manually to be able to open .heic and .heif formats - The extension can be installed without Microsoft account + The extension can be installed without a Microsoft account Открыть страницу "Расширения для видео HEVC от производителя устройства" в Microsoft Store, чтобы вручную установить расширение для открытия форматов .heic и .heif Расширение может быть установлено бесплатно без учетной записи Microsoft #> # HEIF -Manual -# Download and install "HEVC Video Extensions from Device Manufacturer" to be able to open .heic and .heif formats -# Скачать и установить "Расширения для видео HEVC от производителя устройства", чтобы иметь возможность открывать форматы .heic и .heif -HEIF -Install - # Disable Cortana autostarting # Выключить автозагрузку Кортана CortanaAutostart -Disable @@ -1044,10 +1008,10 @@ XboxGameTips -Disable # 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 @@ -1112,38 +1076,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 @@ -1181,33 +1113,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 @@ -1231,12 +1163,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 @@ -1270,43 +1202,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 +# Show the "Install" item in the Cabinet (.cab) filenames extensions context menu +# Отобразить пункт "Установить" в контекстное меню .cab архивов +CABInstallContext -Show - Добавить пункт "Установить" в контекстное меню .cab архивов - Если .cab файлы ассоциированы со сторонним приложением, пункт "Установить" в контекстное меню не будет отображаться, - поэтому принудительно будет восстановлена ассоциация по умолчанию -#> -CABInstallContext -Add +# Hide the "Install" item from the Cabinet (.cab) filenames extensions context menu (default value) +# Скрыть пункт "Установить" из контекстного меню .cab архивов (значение по умолчанию) +# CABInstallContext -Hide -# Remove the "Install" item from the .cab archives context menu (default value) -# Удалить пункт "Установить" из контекстного меню .cab архивов (значение по умолчанию) -# CABInstallContext -Remove +# Show the "Run as different user" item to the .exe filename extensions context menu +# Отобразить пункт "Запуск от имени другого пользователя" в контекстное меню .exe файлов +RunAsDifferentUserContext -Show -# Add the "Run as different user" item to the .exe files types context menu -# Добавить пункт "Запуск от имени другого пользователя" в контекстного меню .exe файлов -RunAsDifferentUserContext -Add +# Hide the "Run as different user" item from the .exe filename extensions context menu (default value) +# Скрыть пункт "Запуск от имени другого пользователя" из контекстное меню .exe файлов (значение по умолчанию) +# RunAsDifferentUserContext -Hide -# Remove the "Run as different user" item from the .exe files types context menu (default value) -# Удалить пункт "Запуск от имени другого пользователя" из контекстное меню .exe файлов (значение по умолчанию) -# RunAsDifferentUserContext -Remove - -# 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 @@ -1317,35 +1242,35 @@ 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 "Edit with Photos" item from the context menu -# Скрыть пункт "Изменить с помощью приложения "Фотографии"" из контекстного меню +# Hide the "Edit with Photos" item from the media files context menu +# Скрыть пункт "Изменить с помощью приложения "Фотографии"" из контекстного меню медиа-файлов EditWithPhotosContext -Hide -# Show the "Edit with Photos" item in the context menu (default value) -# Показывать пункт "Изменить с помощью приложения "Фотографии"" в контекстном меню (значение по умолчанию) +# Show the "Edit with Photos" item in the media files context menu (default value) +# Показывать пункт "Изменить с помощью приложения "Фотографии"" в контекстном меню медиа-файлов (значение по умолчанию) # EditWithPhotosContext -Show -# Hide the "Create a new video" item from the context menu -# Скрыть пункт "Создать новое видео" из контекстного меню +# Hide the "Create a new video" item in the media files context menu +# Скрыть пункт "Создать новое видео" из контекстного меню медиа-файлов CreateANewVideoContext -Hide -# Show the "Create a new video" item in the context menu (default value) -# Показывать пункт "Создать новое видео" в контекстном меню (значение по умолчанию) +# Show the "Create a new video" item in the media files context menu (default value) +# Показывать пункт "Создать новое видео" в контекстном меню медиа-файлов (значение по умолчанию) # CreateANewVideoContext -Show # Hide the "Edit" item from the images context menu # Скрыть пункт "Изменить" из контекстного меню изображений ImagesEditContext -Hide -# Show the "Edit" item from in images context menu (default value) +# Show the "Edit" item in images context menu (default value) # Показывать пункт "Изменить" в контекстном меню изображений (значение по умолчанию) # ImagesEditContext -Show @@ -1357,12 +1282,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 @@ -1373,37 +1298,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 элементов @@ -1420,14 +1345,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 <#