Browse Source

2410.2021 v5.12.5

pull/277/head
Dmitry Nefedov 3 years ago
parent
commit
e381844057
  1. 10
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Functions.ps1
  2. BIN
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Libraries/Microsoft.Windows.SDK.NET.dll
  3. BIN
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Libraries/WinRT.Runtime.dll
  4. 3
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/de-DE/Sophia.psd1
  5. 3
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/en-US/Sophia.psd1
  6. 3
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/es-ES/Sophia.psd1
  7. 3
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/fr-FR/Sophia.psd1
  8. 3
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/hu-HU/Sophia.psd1
  9. 3
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/it-IT/Sophia.psd1
  10. 3
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/pt-BR/Sophia.psd1
  11. 3
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/ru-RU/Sophia.psd1
  12. 7
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/tr-TR/Sophia.psd1
  13. 3
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/uk-UA/Sophia.psd1
  14. 3
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/zh-CN/Sophia.psd1
  15. 4
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Manifest/Sophia.psd1
  16. 158
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Module/Sophia.psm1
  17. 74
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Sophia.ps1
  18. 10
      Sophia Script/Sophia Script for Windows 10/Functions.ps1
  19. 3
      Sophia Script/Sophia Script for Windows 10/Localizations/de-DE/Sophia.psd1
  20. 3
      Sophia Script/Sophia Script for Windows 10/Localizations/en-US/Sophia.psd1
  21. 3
      Sophia Script/Sophia Script for Windows 10/Localizations/es-ES/Sophia.psd1
  22. 3
      Sophia Script/Sophia Script for Windows 10/Localizations/fr-FR/Sophia.psd1
  23. 3
      Sophia Script/Sophia Script for Windows 10/Localizations/hu-HU/Sophia.psd1
  24. 3
      Sophia Script/Sophia Script for Windows 10/Localizations/it-IT/Sophia.psd1
  25. 3
      Sophia Script/Sophia Script for Windows 10/Localizations/pt-BR/Sophia.psd1
  26. 3
      Sophia Script/Sophia Script for Windows 10/Localizations/ru-RU/Sophia.psd1
  27. 7
      Sophia Script/Sophia Script for Windows 10/Localizations/tr-TR/Sophia.psd1
  28. 3
      Sophia Script/Sophia Script for Windows 10/Localizations/uk-UA/Sophia.psd1
  29. 3
      Sophia Script/Sophia Script for Windows 10/Localizations/zh-CN/Sophia.psd1
  30. 4
      Sophia Script/Sophia Script for Windows 10/Manifest/Sophia.psd1
  31. 155
      Sophia Script/Sophia Script for Windows 10/Module/Sophia.psm1
  32. 51
      Sophia Script/Sophia Script for Windows 10/Sophia.ps1

10
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Functions.ps1

@ -2,11 +2,11 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v5.12.4
Date: 05.10.2021
Version: v5.12.5
Date: 24.10.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -54,7 +54,7 @@ function Sophia
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.4 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 20142021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.5 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

BIN
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Libraries/Microsoft.Windows.SDK.NET.dll

Binary file not shown.

BIN
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Libraries/WinRT.Runtime.dll

Binary file not shown.

3
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/de-DE/Sophia.psd1

@ -15,6 +15,7 @@ ScheduledTasks = Geplante Aufgaben
OneDriveUninstalling = Deinstalliere OneDrive...
OneDriveInstalling = Installieren von OneDrive...
OneDriveDownloading = OneDrive herunterladen... ~33 MB
OneDriveWarning = Die "{0}"-Funktion wird nur angewendet, wenn die Voreinstellung so konfiguriert ist, dass OneDrive entfernt wird, andernfalls wird die Backup-Funktionalität für die Ordner "Desktop" und "Bilder" in OneDrive unterbrochen
WindowsFeaturesTitle = Windows-Features
OptionalFeaturesTitle = Optionale Features
EnableHardwareVT = Virtualisierung in UEFI aktivieren
@ -75,7 +76,7 @@ Run = Starten
SelectAll = Wählen Sie Alle
Skip = Überspringen
Skipped = Übersprungen
FileExplorerRestartPrompt = Manchmal muss der Datei-Explorer neu gestartet werden, damit die Änderungen wirksam werden
FileExplorerRestartPrompt = \nManchmal muss der Datei-Explorer neu gestartet werden, damit die Änderungen wirksam werden
TelegramGroupTitle = Treten Sie unserer offiziellen Telegram-Gruppe bei
TelegramChannelTitle = Treten Sie unserem offiziellen Telegram-Kanal bei
Uninstall = Deinstallieren

3
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/en-US/Sophia.psd1

@ -15,6 +15,7 @@ ScheduledTasks = Scheduled tasks
OneDriveUninstalling = Uninstalling OneDrive...
OneDriveInstalling = Installing OneDrive...
OneDriveDownloading = Downloading OneDrive... ~33 MB
OneDriveWarning = The "{0}" function will be applied only if the preset is configured to remove OneDrive, otherwise the backup functionality for the "Desktop" and "Pictures" folders in OneDrive breaks
WindowsFeaturesTitle = Windows features
OptionalFeaturesTitle = Optional features
EnableHardwareVT = Enable Virtualization in UEFI
@ -75,7 +76,7 @@ Run = Run
SelectAll = Select all
Skip = Skip
Skipped = Skipped
FileExplorerRestartPrompt = Sometimes in order for the changes to take effect the File Explorer process has to be restarted
FileExplorerRestartPrompt = \nSometimes in order for the changes to take effect the File Explorer process has to be restarted
TelegramGroupTitle = Join our official Telegram group
TelegramChannelTitle = Join our official Telegram channel
Uninstall = Uninstall

3
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/es-ES/Sophia.psd1

@ -15,6 +15,7 @@ ScheduledTasks = Tareas programadas
OneDriveUninstalling = Desinstalar OneDrive...
OneDriveInstalling = Instalación de OneDrive...
OneDriveDownloading = Descargando OneDrive... ~33 MB
OneDriveWarning = La función "{0}" se aplicará sólo si el preajuste está configurado para eliminar OneDrive, de lo contrario la funcionalidad de copia de seguridad para las carpetas "Escritorio" e "Imágenes" en OneDrive se rompe
WindowsFeaturesTitle = Características de Windows
OptionalFeaturesTitle = Características opcionales
EnableHardwareVT = Habilitar la virtualización en UEFI
@ -75,7 +76,7 @@ Run = Iniciar
SelectAll = Seleccionar todo
Skip = Omitir
Skipped = Omitido
FileExplorerRestartPrompt = A veces, para que los cambios surtan efecto, hay que reiniciar el proceso del Explorador de archivos
FileExplorerRestartPrompt = \nA veces, para que los cambios surtan efecto, hay que reiniciar el proceso del Explorador de archivos
TelegramGroupTitle = Únete a nuestro grupo oficial de Telegram
TelegramChannelTitle = Únete a nuestro canal oficial de Telegram
Uninstall = Desinstalar

3
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/fr-FR/Sophia.psd1

@ -15,6 +15,7 @@ ScheduledTasks = Tâches planifiées
OneDriveUninstalling = Désinstalltion de OneDrive...
OneDriveInstalling = Installation de OneDrive...
OneDriveDownloading = Téléchargement de OneDrive... ~33 Mo
OneDriveWarning = La fonction "{0}" sera appliquée uniquement si le préréglage est configuré pour supprimer OneDrive, sinon la fonctionnalité de sauvegarde des dossiers "Desktop" et "Pictures" dans OneDrive s'interrompt.
WindowsFeaturesTitle = Fonctionnalités
OptionalFeaturesTitle = Fonctionnalités optionnelles
EnableHardwareVT = Activer la virtualisation dans UEFI
@ -75,7 +76,7 @@ Run = Démarrer
SelectAll = Tout sélectionner
Skip = Passer
Skipped = Passé
FileExplorerRestartPrompt = Parfois, pour que les modifications soient prises en compte, il faut redémarrer l'Explorateur de fichiers
FileExplorerRestartPrompt = \nParfois, pour que les modifications soient prises en compte, il faut redémarrer l'Explorateur de fichiers
TelegramGroupTitle = Rejoignez notre groupe Telegram officiel
TelegramChannelTitle = Rejoignez notre canal Telegram officiel
Uninstall = Désinstaller

3
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/hu-HU/Sophia.psd1

@ -15,6 +15,7 @@ ScheduledTasks = Ütemezett feladatok
OneDriveUninstalling = OneDrive eltávolítása...
OneDriveInstalling = OneDrive telepítése...
OneDriveDownloading = OneDrive letöltése... ~33 MB
OneDriveWarning = A "{0}" funkció csak akkor kerül alkalmazásra, ha az előbeállítás a OneDrive eltávolítására van beállítva, különben a OneDrive "Desktop" és "Pictures" mappáinak biztonsági mentési funkciója megszakad.
WindowsFeaturesTitle = Windows szolgáltatások
OptionalFeaturesTitle = Opcionális szolgáltatások
EnableHardwareVT = Virtualizáció engedélyezése UEFI-ben
@ -75,7 +76,7 @@ Run = Futtatás
SelectAll = Összes kijelölése
Skip = Átugrás
Skipped = Átugorva
FileExplorerRestartPrompt = Néha ahhoz, hogy a módosítások hatályba lépjenek, a File Explorer folyamatot újra kell indítani
FileExplorerRestartPrompt = \nNéha ahhoz, hogy a módosítások hatályba lépjenek, a File Explorer folyamatot újra kell indítani
TelegramGroupTitle = Pridružite se našoj službenoj grupi Telegram
TelegramChannelTitle = Pridružite se našem službenom kanalu Telegram
Uninstall = Eltávolít

3
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/it-IT/Sophia.psd1

@ -15,6 +15,7 @@ ScheduledTasks = Attività pianificate
OneDriveUninstalling = Disinstalla OneDrive...
OneDriveInstalling = Installazione di OneDrive...
OneDriveDownloading = Download di OneDrive... ~33 MB
OneDriveWarning = La funzione "{0}" sarà applicata solo se il preset è configurato per rimuovere OneDrive, altrimenti la funzionalità di backup per le cartelle "Desktop" e "Pictures" in OneDrive si interrompe
WindowsFeaturesTitle = Funzionalità di Windows
OptionalFeaturesTitle = Caratteristiche opzionali
EnableHardwareVT = Abilita virtualizzazione in UEFI
@ -75,7 +76,7 @@ Run = Eseguire
SelectAll = Seleziona tutto
Skip = Salta
Skipped = Saltato
FileExplorerRestartPrompt = A volte, affinché le modifiche abbiano effetto, il processo di File Explorer deve essere riavviato
FileExplorerRestartPrompt = \nA volte, affinché le modifiche abbiano effetto, il processo di File Explorer deve essere riavviato
TelegramGroupTitle = Unisciti al nostro gruppo ufficiale Telegram
TelegramChannelTitle = Unisciti al nostro canale ufficiale di Telegram
Uninstall = Disinstallare

3
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/pt-BR/Sophia.psd1

@ -15,6 +15,7 @@ ScheduledTasks = Tarefas agendadas
OneDriveUninstalling = Desinstalar OneDrive...
OneDriveInstalling = Instalar o OneDrive...
OneDriveDownloading = Baixando OneDrive... ~33 MB
OneDriveWarning = A função "{0}" será aplicada somente se a predefinição for configurada para remover o OneDrive, caso contrário a funcionalidade de backup para as pastas "Desktop" e "Pictures" no OneDrive quebra
WindowsFeaturesTitle = Recursos do Windows
OptionalFeaturesTitle = Recursos opcionais
EnableHardwareVT = Habilitar virtualização em UEFI
@ -75,7 +76,7 @@ Run = Executar
SelectAll = Selecionar tudo
Skip = Pular
Skipped = Ignorados
FileExplorerRestartPrompt = Por vezes, para que as alterações tenham efeito, o processo File Explorer tem de ser reiniciado
FileExplorerRestartPrompt = \nPor vezes, para que as alterações tenham efeito, o processo File Explorer tem de ser reiniciado
TelegramGroupTitle = Entre no grupo oficial do Telegram
TelegramChannelTitle = Entre no canal oficial do Telegram
Uninstall = Desinstalar

3
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/ru-RU/Sophia.psd1

@ -15,6 +15,7 @@ ScheduledTasks = Запланированные за
OneDriveUninstalling = Удаление OneDrive...
OneDriveInstalling = OneDrive устанавливается...
OneDriveDownloading = Скачивается OneDrive... ~33 МБ
OneDriveWarning = Функция "{0}" будет применена только в случае, если в пресете настроено удаление приложения OneDrive, иначе ломается функционал резервного копирования для папок "Рабочий стол" и "Изображения" в OneDrive
WindowsFeaturesTitle = Компоненты Windows
OptionalFeaturesTitle = Дополнительные компоненты
EnableHardwareVT = Включите виртуализацию в UEFI
@ -75,7 +76,7 @@ Run = Запустить
SelectAll = Выбрать всё
Skip = Пропустить
Skipped = Пропущено
FileExplorerRestartPrompt = Иногда для того, чтобы изменения вступили в силу, процесс проводника необходимо перезапустить
FileExplorerRestartPrompt = \nИногда для того, чтобы изменения вступили в силу, процесс проводника необходимо перезапустить
TelegramGroupTitle = Присоединяйтесь к нашей официальной группе в Telegram
TelegramChannelTitle = Присоединяйтесь к нашему официальному каналу в Telegram
Uninstall = Удалить

7
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/tr-TR/Sophia.psd1

@ -15,8 +15,9 @@ ScheduledTasks = Zamanlanan görevler
OneDriveUninstalling = OneDrive kaldırılıyor...
OneDriveInstalling = OneDrive kuruluyor...
OneDriveDownloading = OneDrive indiriliyor... ~33 MB
WindowsFeaturesTitle = Windows özellikleri
OptionalFeaturesTitle = İsteğe bağlı özellikler
OneDriveWarning = "{0}" işlevi yalnızca ön ayar OneDrive'ı kaldıracak şekilde yapılandırılırsa uygulanır, aksi takdirde OneDrive'daki "Masaüstü" ve "Resimler" klasörleri için yedekleme işlevi bozulur
WindowsFeaturesTitle = Características do Windows
OptionalFeaturesTitle = Opsiyonel özellikler
EnableHardwareVT = UEFI'dan sanallaştırmayı aktifleştirin
UserShellFolderNotEmpty = "{0}" klasöründe bazı dosyalar kaldı. \nKendiniz yeni konuma taşıyın
RetrievingDrivesList = Sürücü listesi alınıyor...
@ -75,7 +76,7 @@ Run = Başlat
SelectAll = Hepsini seç
Skip = Atla
Skipped = Atlandı
FileExplorerRestartPrompt = Bazen değişikliklerin geçerli olması için Dosya Gezgini işleminin yeniden başlatılması gerekir
FileExplorerRestartPrompt = \nBazen değişikliklerin geçerli olması için Dosya Gezgini işleminin yeniden başlatılması gerekir
TelegramGroupTitle = Resmi Telegram grubumuza katılın
TelegramChannelTitle = Resmi Telegram kanalımıza katılın
Uninstall = Kaldır

3
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/uk-UA/Sophia.psd1

@ -15,6 +15,7 @@ ScheduledTasks = Заплановані задачі
OneDriveUninstalling = Видалення OneDrive...
OneDriveInstalling = OneDrive встановлюється...
OneDriveDownloading = Завантажується OneDrive... ~33 МБ
OneDriveWarning = Функція "{0}" буде застосована тільки в разі, якщо в пресете налаштоване щоб видалити програму OneDrive, інакше ламається функціонал резервного копіювання для папок "Робочий стіл" і "Зображення" в OneDrive
WindowsFeaturesTitle = Компоненти Windows
OptionalFeaturesTitle = Додаткові компоненти
EnableHardwareVT = Увімкніть віртуалізацію в UEFI
@ -75,7 +76,7 @@ Run = Запустити
SelectAll = Вибрати все
Skip = Пропустити
Skipped = Пропущено
FileExplorerRestartPrompt = Іноді для того, щоб зміни вступили в силу, процес провідника необхідно перезапустити
FileExplorerRestartPrompt = \nІноді для того, щоб зміни вступили в силу, процес провідника необхідно перезапустити
TelegramGroupTitle = Приєднуйтесь до нашої офіційної групи в Telegram
TelegramChannelTitle = Приєднуйтесь до нашого офіційного каналу в Telegram
Uninstall = Видалити

3
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Localizations/zh-CN/Sophia.psd1

@ -15,6 +15,7 @@ ScheduledTasks = 计划任务
OneDriveUninstalling = 卸载OneDrive
OneDriveInstalling = OneDrive正在安装
OneDriveDownloading = 正在下载OneDrive ~33 MB
OneDriveWarning = 只有当预设被配置为删除OneDrive时才会应用"{0}"功能否则OneDrive中的 "桌面 " "图片 "文件夹的备份功能就会中断
WindowsFeaturesTitle = Windows功能
OptionalFeaturesTitle = 可选功能
EnableHardwareVT = UEFI中开启虚拟化
@ -75,7 +76,7 @@ Run = 运行
SelectAll = 全选
Skip = 跳过
Skipped = 已跳过
FileExplorerRestartPrompt = 有时为了使更改生效必须重新启动文件管理器进程
FileExplorerRestartPrompt = \n有时为了使更改生效必须重新启动文件管理器进程
TelegramGroupTitle = 加入我们的官方Telegram
TelegramChannelTitle = 加入我们的官方Telegram 频道
Uninstall = 卸载

4
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Manifest/Sophia.psd1

@ -1,9 +1,9 @@
@{
RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '5.12.4'
ModuleVersion = '5.12.5'
GUID = 'aa0b47a7-1770-4b5d-8c9f-cc6c505bcc7a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 20142021 farag & Inestic. All rights reserved'
Copyright = '(c) 20142021 farag & Inestic. All rights reserved'
Description = 'Module for Windows fine-tuning and automating the routine tasks'
PowerShellVersion = '7.1'
ProcessorArchitecture = 'AMD64'

158
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Module/Sophia.psm1

@ -2,11 +2,11 @@
.SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v5.12.4
Date: 05.10.2021
Version: v5.12.5
Date: 24.10.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -594,39 +594,30 @@ function ScheduledTasks
# The following tasks will have their checkboxes checked
[string[]]$CheckedScheduledTasks = @(
# Collects program telemetry information if opted-in to the Microsoft Customer Experience Improvement Program
# Сбор телеметрических данных программы при участии в программе улучшения качества ПО
"ProgramDataUpdater",
# This task collects and uploads autochk SQM data if opted-in to the Microsoft Customer Experience Improvement Program
# Эта задача собирает и загружает данные SQM при участии в программе улучшения качества программного обеспечения
"Proxy",
# If the user has consented to participate in the Windows Customer Experience Improvement Program, this job collects and sends usage data to Microsoft
# Если пользователь изъявил желание участвовать в программе по улучшению качества программного обеспечения Windows, эта задача будет собирать и отправлять сведения о работе программного обеспечения в Майкрософт
"Consolidator",
# The USB CEIP (Customer Experience Improvement Program) task collects Universal Serial Bus related statistics and information about your machine and sends it to the Windows Device Connectivity engineering group at Microsoft
# При выполнении задачи программы улучшения качества ПО шины USB (USB CEIP) осуществляется сбор статистических данных об использовании универсальной последовательной шины USB и с ведений о компьютере, которые направляются инженерной группе Майкрософт по вопросам подключения устройств в Windows
"UsbCeip",
# The Windows Disk Diagnostic reports general disk and system information to Microsoft for users participating in the Customer Experience Program
# Для пользователей, участвующих в программе контроля качества программного обеспечения, служба диагностики дисков Windows предоставляет общие сведения о дисках и системе в корпорацию Майкрософт
"Microsoft-Windows-DiskDiagnosticDataCollector",
# This task shows various Map related toasts
# Эта задача показывает различные тосты (всплывающие уведомления) приложения "Карты"
"MapsToastTask",
# This task checks for updates to maps which you have downloaded for offline use
# Эта задача проверяет наличие обновлений для карт, загруженных для автономного использования
"MapsUpdateTask",
# Initializes Family Safety monitoring and enforcement
# Инициализация контроля и применения правил семейной безопасности
"FamilySafetyMonitor",
# Synchronizes the latest settings with the Microsoft family features service
# Синхронизирует последние параметры со службой функций семьи учетных записей Майкрософт
"FamilySafetyRefreshTask",
# XblGameSave Standby Task
@ -860,7 +851,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Add-Type @SetForegroundWindow
}
Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -match "Sophia Script for Windows 10"} | ForEach-Object -Process {
Get-Process | Where-Object -FilterScript {(($_.ProcessName -eq "powershell") -or ($_.ProcessName -eq "WindowsTerminal")) -and ($_.MainWindowTitle -match "Sophia Script for Windows 10")} | ForEach-Object -Process {
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
@ -3539,7 +3530,7 @@ public static bool MarkFileDelete (string sourcefile)
"@
}
# If there are some files or folders left in %LOCALAPPDATA\Temp%
# 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]))
@ -3570,7 +3561,7 @@ public static bool MarkFileDelete (string sourcefile)
Remove-Item -Path HKLM:\SOFTWARE\WOW6432Node\Microsoft\OneDrive -Recurse -Force -ErrorAction Ignore
Remove-Item -Path "$env:ProgramData\Microsoft OneDrive" -Recurse -Force -ErrorAction Ignore
Remove-Item -Path $env:SystemDrive\OneDriveTemp -Recurse -Force -ErrorAction Ignore
Unregister-ScheduledTask -TaskName *OneDrive* -Confirm:$false
Unregister-ScheduledTask -TaskName *OneDrive* -Confirm:$false -ErrorAction Ignore
# Getting the OneDrive folder path
$OneDriveFolder = Split-Path -Path (Split-Path -Path $OneDriveSetup[0] -Parent)
@ -3593,6 +3584,7 @@ public static bool MarkFileDelete (string sourcefile)
Invoke-Item -Path $Script:OpenedFolder
}
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoRestartShell -Value 1 -Force
# Attempt to unregister FileSyncShell64.dll and remove
@ -3705,6 +3697,9 @@ public static bool MarkFileDelete (string sourcefile)
}
}
# Save screenshots by pressing Win+PrtScr in the Pictures folder
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{B7BEDE81-DF94-4682-A7D8-57A52620B86F}" -Force -ErrorAction Ignore
Get-ScheduledTask -TaskName "Onedrive* Update*" | Enable-ScheduledTask
Get-ScheduledTask -TaskName "Onedrive* Update*" | Start-ScheduledTask
}
@ -3776,56 +3771,56 @@ function StorageSense
<#
.SYNOPSIS
Clean up of temporary files
Storage Sense running frequency
.PARAMETER Enable
Delete temporary files that apps aren't using
.PARAMETER Month
Run Storage Sense every month
.PARAMETER Disable
Do not delete temporary files that apps aren't using
.PARAMETER Default
Run Storage Sense during low free disk space
.EXAMPLE
StorageSenseTempFiles -Enable
StorageSenseFrequency -Month
.EXAMPLE
StorageSenseTempFiles -Disable
StorageSenseFrequency -Default
.NOTES
Current user
#>
function StorageSenseTempFiles
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 04 -PropertyType DWord -Value 1 -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 04 -PropertyType DWord -Value 0 -Force
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 2048 -PropertyType DWord -Value 0 -Force
}
}
}
@ -3833,56 +3828,56 @@ function StorageSenseTempFiles
<#
.SYNOPSIS
Storage Sense running frequency
Clean up of temporary files
.PARAMETER Month
Run Storage Sense every month
.PARAMETER Enable
Delete temporary files that apps aren't using
.PARAMETER Default
Run Storage Sense during low free disk space
.PARAMETER Disable
Do not delete temporary files that apps aren't using
.EXAMPLE
StorageSenseFrequency -Month
StorageSenseTempFiles -Enable
.EXAMPLE
StorageSenseFrequency -Default
StorageSenseTempFiles -Disable
.NOTES
Current user
#>
function StorageSenseFrequency
function StorageSenseTempFiles
{
param
(
[Parameter(
Mandatory = $true,
ParameterSetName = "Month"
ParameterSetName = "Enable"
)]
[switch]
$Month,
$Enable,
[Parameter(
Mandatory = $true,
ParameterSetName = "Default"
ParameterSetName = "Disable"
)]
[switch]
$Default
$Disable
)
switch ($PSCmdlet.ParameterSetName)
{
"Month"
"Enable"
{
if ((Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01) -eq "1")
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 2048 -PropertyType DWord -Value 30 -Force
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 04 -PropertyType DWord -Value 1 -Force
}
}
"Default"
"Disable"
{
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 0 -Force
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 04 -PropertyType DWord -Value 0 -Force
}
}
}
@ -4085,6 +4080,7 @@ Unregister-ScheduledTask -TaskName SymbolicLink -Confirm:`$false
#region main
# Change the %TEMP% environment variable path to %LOCALAPPDATA%\Temp
# The additional registry key creating are needed to fix the property type of the keys: SetEnvironmentVariable creates them with the "String" type instead of "ExpandString" as by default
[Environment]::SetEnvironmentVariable("TMP", "$env:SystemDrive\Temp", "User")
[Environment]::SetEnvironmentVariable("TMP", "$env:SystemDrive\Temp", "Machine")
[Environment]::SetEnvironmentVariable("TMP", "$env:SystemDrive\Temp", "Process")
@ -4634,7 +4630,6 @@ function WindowsFeatures
# The following Windows features will have their checkboxes checked
[string[]]$CheckedFeatures = @(
# Legacy Components
# Компоненты прежних версий
"LegacyComponents",
# PowerShell 2.0
@ -4642,11 +4637,9 @@ function WindowsFeatures
"MicrosoftWindowsPowershellV2Root",
# Microsoft XPS Document Writer
# Средство записи XPS-документов (Microsoft)
"Printing-XPSServices-Features",
# Work Folders Client
# Клиент рабочих папок
"WorkFolders-Client"
)
@ -4884,7 +4877,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Add-Type @SetForegroundWindow
}
Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -match "Sophia Script for Windows 10"} | ForEach-Object -Process {
Get-Process | Where-Object -FilterScript {(($_.ProcessName -eq "powershell") -or ($_.ProcessName -eq "WindowsTerminal")) -and ($_.MainWindowTitle -match "Sophia Script for Windows 10")} | ForEach-Object -Process {
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
@ -4961,11 +4954,9 @@ function WindowsCapabilities
# The following optional features will have their checkboxes checked
[string[]]$CheckedCapabilities = @(
# Steps Recorder
# Средство записи действий
"App.StepsRecorder*",
# Microsoft Quick Assist
# Быстрая поддержка (Майкрософт)
"App.Support.QuickAssist*",
# Microsoft Paint
@ -4981,7 +4972,6 @@ function WindowsCapabilities
"Browser.InternetExplorer*",
# Math Recognizer
# Распознаватель математических знаков
"MathRecognizer*",
# Windows Media Player
@ -4989,38 +4979,30 @@ function WindowsCapabilities
"Media.WindowsMediaPlayer*",
# OpenSSH Client
# Клиент OpenSSH
"OpenSSH.Client*"
)
# The following optional features will be excluded from the display
[string[]]$ExcludedCapabilities = @(
# The DirectX Database to configure and optimize apps when multiple Graphics Adapters are present
# База данных DirectX для настройки и оптимизации приложений при наличии нескольких графических адаптеров
"DirectX.Configuration.Database*",
# Language components
# Языковые компоненты
"Language.*",
# Notepad
# Блокнот
"Microsoft.Windows.Notepad*",
# Mail, contacts, and calendar sync component
# Компонент синхронизации почты, контактов и календаря
"OneCoreUAP.OneSync*",
# Windows PowerShell Intergrated Scripting Enviroment
# Интегрированная среда сценариев Windows PowerShell
"Microsoft.Windows.PowerShell.ISE*",
# Management of printers, printer drivers, and printer servers
# Управление принтерами, драйверами принтеров и принт-серверами
"Print.Management.Console*",
# Features critical to Windows functionality
# Компоненты, критичные для работоспособности Windows
"Windows.Client.ShellComponents*"
)
#endregion Variables
@ -5284,7 +5266,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Add-Type @SetForegroundWindow
}
Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -match "Sophia Script for Windows 10"} | ForEach-Object -Process {
Get-Process | Where-Object -FilterScript {(($_.ProcessName -eq "powershell") -or ($_.ProcessName -eq "WindowsTerminal")) -and ($_.MainWindowTitle -match "Sophia Script for Windows 10")} | ForEach-Object -Process {
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
@ -5357,7 +5339,7 @@ function UpdateMicrosoftProducts
}
"Disable"
{
if ((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"})
if (((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"}).IsDefaultAUService -eq $true)
{
(New-Object -ComObject Microsoft.Update.ServiceManager).RemoveService("7971f918-a847-4430-9279-4a52d1efe18d")
}
@ -5614,14 +5596,14 @@ function IPv6Component
{
if ($null -eq $IPv6Test)
{
Disable-NetAdapterBinding Name * ComponentID ms_tcpip6
Disable-NetAdapterBinding -Name * -ComponentID ms_tcpip6
}
}
"Enable"
{
if ($IPv6Test)
{
Enable-NetAdapterBinding Name * ComponentID ms_tcpip6
Enable-NetAdapterBinding -Name * -ComponentID ms_tcpip6
}
}
}
@ -6694,6 +6676,10 @@ public static string GetString(uint strId)
.EXAMPLE
WinPrtScrFolder -Default
.NOTES
The function will be applied only if the preset is configured to remove OneDrive,
otherwise the backup functionality for the "Desktop" and "Pictures" folders in OneDrive breaks
.NOTES
Current user
#>
@ -6720,8 +6706,16 @@ function WinPrtScrFolder
{
"Desktop"
{
$DesktopFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name Desktop
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{B7BEDE81-DF94-4682-A7D8-57A52620B86F}" -Type ExpandString -Value $DesktopFolder -Force
if ((Get-Content -Path $PSScriptRoot\..\Sophia.ps1 -Encoding UTF8 -Force | Select-String -SimpleMatch "OneDrive -Uninstall").Line.StartsWith("#") -eq $false)
{
$DesktopFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name Desktop
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{B7BEDE81-DF94-4682-A7D8-57A52620B86F}" -Type ExpandString -Value $DesktopFolder -Force
}
else
{
Write-Warning -Message ($Localization.OneDriveWarning -f $MyInvocation.Line)
Write-Error -Message ($Localization.OneDriveWarning -f $MyInvocation.Line) -ErrorAction SilentlyContinue
}
}
"Default"
{
@ -8261,7 +8255,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Add-Type @SetForegroundWindow
}
Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -match "Sophia Script for Windows 11"} | ForEach-Object -Process {
Get-Process | Where-Object -FilterScript {(($_.ProcessName -eq "powershell") -or ($_.ProcessName -eq "WindowsTerminal")) -and ($_.MainWindowTitle -match "Sophia Script for Windows 10")} | ForEach-Object -Process {
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
@ -9167,7 +9161,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Add-Type @SetForegroundWindow
}
Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -match "Sophia Script for Windows 10"} | ForEach-Object -Process {
Get-Process | Where-Object -FilterScript {(($_.ProcessName -eq "powershell") -or ($_.ProcessName -eq "WindowsTerminal")) -and ($_.MainWindowTitle -match "Sophia Script for Windows 10")} | ForEach-Object -Process {
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
@ -9497,7 +9491,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Add-Type @SetForegroundWindow
}
Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -match "Sophia Script for Windows 10"} | ForEach-Object -Process {
Get-Process | Where-Object -FilterScript {(($_.ProcessName -eq "powershell") -or ($_.ProcessName -eq "WindowsTerminal")) -and ($_.MainWindowTitle -match "Sophia Script for Windows 10")} | ForEach-Object -Process {
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
@ -10350,8 +10344,8 @@ while (`$true)
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel" -Name ShowInActionCenter -Force -ErrorAction Ignore
Unregister-ScheduledTask -TaskName "Windows Cleanup" -Confirm:$false
Unregister-ScheduledTask -TaskName "Windows Cleanup Notification" -Confirm:$false
Unregister-ScheduledTask -TaskName "Windows Cleanup" -Confirm:$false -ErrorAction Ignore
Unregister-ScheduledTask -TaskName "Windows Cleanup Notification" -Confirm:$false -ErrorAction Ignore
Remove-Item -Path Registry::HKEY_CLASSES_ROOT\WindowsCleanup -Recurse -Force -ErrorAction Ignore
}
@ -10458,7 +10452,7 @@ Get-ChildItem -Path `$env:SystemRoot\SoftwareDistribution\Download -Recurse -For
}
"Delete"
{
Unregister-ScheduledTask -TaskName SoftwareDistribution -Confirm:$false
Unregister-ScheduledTask -TaskName SoftwareDistribution -Confirm:$false -ErrorAction Ignore
}
}
}
@ -10555,7 +10549,7 @@ Get-ChildItem -Path `$env:TEMP -Recurse -Force | Where-Object {`$_.CreationTime
}
"Delete"
{
Unregister-ScheduledTask -TaskName Temp -Confirm:$false
Unregister-ScheduledTask -TaskName Temp -Confirm:$false -ErrorAction Ignore
}
}
}
@ -11414,18 +11408,18 @@ function CABInstallContext
{
"Show"
{
if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs\Command))
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
New-Item -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\runas\Command -Force
}
$Value = "{0}" -f "cmd /c DISM.exe /Online /Add-Package /PackagePath:`"%1`" /NoRestart & pause"
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs\Command -Name "(default)" -PropertyType String -Value $Value -Force
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
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\runas\Command -Name "(default)" -PropertyType String -Value $Value -Force
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 Ignore
Remove-Item -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\runas -Recurse -Force -ErrorAction Ignore
}
}
}

74
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Sophia.ps1

@ -2,11 +2,11 @@
.SYNOPSIS
Default preset file for "Sophia Script for Windows 10 (PowerShell 7)"
Version: v5.12.3
Date: 19.09.2021
Version: v5.12.5
Date: 24.10.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -21,7 +21,7 @@
.EXAMPLE Run the script by specifying the module functions as an argument
.\Sophia.ps1 -Functions "DiagTrackService -Disable", "DiagnosticDataLevel -Minimal", UninstallUWPApps
.EXAMPLE Download and expand the archive (without running) the latest Sophia Script according which Windows and PowerShell versions it is run on
.EXAMPLE Download and expand the latest Sophia Script version archive (without running) according which Windows and PowerShell versions it is run on
irm script.sophi.app | iex
Invoke-RestMethod -Uri script.sophi.app | Invoke-Expression
@ -72,7 +72,7 @@ param
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.3 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 20142021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.5 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force
@ -537,12 +537,12 @@ AppsLanguageSwitch -Enable
# Не использовать метод ввода для каждого окна (значение по умолчанию)
# AppsLanguageSwitch -Disable
# When I grab a windows's title bar and shake it, minimize all other windows
# При захвате заголовка окна и встряхивании сворачиваются все остальные окна
# When I grab a windows's title bar and shake it, minimize all other windows (default value)
# При захвате заголовка окна и встряхивании сворачиваются все остальные окна (значение по умолчанию)
AeroShaking -Enable
# When I grab a windows's title bar and shake it, don't minimize all other windows (default value)
# При захвате заголовка окна и встряхивании не сворачиваются все остальные окна (значение по умолчанию)
# When I grab a windows's title bar and shake it, don't minimize all other windows
# При захвате заголовка окна и встряхивании не сворачиваются все остальные окна
# AeroShaking -Disable
#endregion UI & Personalization
@ -551,8 +551,8 @@ AeroShaking -Enable
# Удалить OneDrive. Папка пользователя OneDrive не будет удалена
OneDrive -Uninstall
# Install OneDrive (default value)
# Установить OneDrive (значение по умолчанию)
# Install OneDrive 64-bit (default value)
# Установить OneDrive 64-бит (значение по умолчанию)
# OneDrive -Install
#endregion OneDrive
@ -566,14 +566,6 @@ StorageSense -Enable
# Выключить Контроль памяти (значение по умолчанию)
# StorageSense -Disable
# Delete temporary files that apps aren't using
# Удалять временные файлы, не используемые в приложениях
StorageSenseTempFiles -Enable
# Do not delete temporary files that apps aren't using
# Не удалять временные файлы, не используемые в приложениях
# StorageSenseTempFiles -Disable
# Run Storage Sense every month
# Запускать Контроль памяти каждый месяц
StorageSenseFrequency -Month
@ -581,6 +573,14 @@ StorageSenseFrequency -Month
# Run Storage Sense during low free disk space (default value)
# Запускать Контроль памяти, когда остается мало место на диске (значение по умолчанию)
# StorageSenseFrequency -Default
# Delete temporary files that apps aren't using
# Удалять временные файлы, не используемые в приложениях
StorageSenseTempFiles -Enable
# Do not delete temporary files that apps aren't using
# Не удалять временные файлы, не используемые в приложениях
# StorageSenseTempFiles -Disable
#endregion StorageSense
# Disable hibernation. Do not recommend turning it off on laptops
@ -777,11 +777,18 @@ SetUserShellFolderLocation -Root
#>
# SetUserShellFolderLocation -Default
# Save screenshots by pressing Win+PrtScr on the Desktop
# Сохранять скриншоты по нажатию Win+PrtScr на рабочий столе
<#
Save screenshots by pressing Win+PrtScr on the Desktop
The function will be applied only if the preset is configured to remove the OneDrive application
Otherwise the backup functionality for the "Desktop" and "Pictures" folders in OneDrive breaks
Сохранять скриншоты по нажатию Win+PrtScr на рабочий столе
Функция будет применена только в случае, если в пресете настроено удаление приложения OneDrive,
иначе ломается функционал резервного копирования для папок "Рабочий стол" и "Изображения" в OneDrive
#>
WinPrtScrFolder -Desktop
# Save screenshots by pressing Win+PrtScr on the Pictures folder (default value)
# Save screenshots by pressing Win+PrtScr in the Pictures folder (default value)
# Cохранять скриншоты по нажатию Win+PrtScr в папку "Изображения" (значение по умолчанию)
# WinPrtScrFolder -Default
@ -835,14 +842,14 @@ NumLock -Enable
# Выключить Num Lock при загрузке (значение по умолчанию)
# NumLock -Disable
# Enable Caps Lock
# Включить Caps Lock
# CapsLock -Enable
# Disable Caps Lock (default value)
# Выключить Caps Lock (значение по умолчанию)
# Disable Caps Lock
# Выключить Caps Lock
# CapsLock -Disable
# Enable Caps Lock (default value)
# Включить Caps Lock (значение по умолчанию)
# CapsLock -Enable
# Turn off pressing the Shift key 5 times to turn Sticky keys
# Выключить залипание клавиши Shift после 5 нажатий
StickyShift -Disable
@ -910,8 +917,13 @@ RestartDeviceAfterUpdate -Enable
#endregion System
#region WSL
# Enable Windows Subsystem for Linux (WSL), install the latest WSL Linux kernel version, and a Linux distribution using a pop-up form
# Установить подсистему Windows для Linux (WSL), последний пакет обновления ядра Linux и дистрибутив Linux, используя всплывающую форму
<#
Enable Windows Subsystem for Linux (WSL), install the latest WSL Linux kernel version, and a Linux distribution using a pop-up form
To receive kernel updates, enable the Windows Update setting: "Receive updates for other Microsoft products"
Установить подсистему Windows для Linux (WSL), последний пакет обновления ядра Linux и дистрибутив Linux, используя всплывающую форму
Чтобы получать обновления ядра, включите параметр "При обновлении Windows поулчать обновления для других продуктов Майкрософт" в Центре обновлении Windows
#>
# WSL -Enable
#endregion WSL

10
Sophia Script/Sophia Script for Windows 10/Functions.ps1

@ -2,11 +2,11 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v5.12.4
Date: 05.10.2021
Version: v5.12.5
Date: 24.10.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -54,7 +54,7 @@ function Sophia
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.4 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 20142021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.5 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

3
Sophia Script/Sophia Script for Windows 10/Localizations/de-DE/Sophia.psd1

@ -14,6 +14,7 @@ ScheduledTasks = Geplante Aufgaben
OneDriveUninstalling = Deinstalliere OneDrive...
OneDriveInstalling = Installieren von OneDrive...
OneDriveDownloading = OneDrive herunterladen... ~33 MB
OneDriveWarning = Die "{0}"-Funktion wird nur angewendet, wenn die Voreinstellung so konfiguriert ist, dass OneDrive entfernt wird, andernfalls wird die Backup-Funktionalität für die Ordner "Desktop" und "Bilder" in OneDrive unterbrochen
WindowsFeaturesTitle = Windows-Features
OptionalFeaturesTitle = Optionale Features
EnableHardwareVT = Virtualisierung in UEFI aktivieren
@ -74,7 +75,7 @@ Run = Starten
SelectAll = Wählen Sie Alle
Skip = Überspringen
Skipped = Übersprungen
FileExplorerRestartPrompt = Manchmal muss der Datei-Explorer neu gestartet werden, damit die Änderungen wirksam werden
FileExplorerRestartPrompt = \nManchmal muss der Datei-Explorer neu gestartet werden, damit die Änderungen wirksam werden
TelegramGroupTitle = Treten Sie unserer offiziellen Telegram-Gruppe bei
TelegramChannelTitle = Treten Sie unserem offiziellen Telegram-Kanal bei
Uninstall = Deinstallieren

3
Sophia Script/Sophia Script for Windows 10/Localizations/en-US/Sophia.psd1

@ -14,6 +14,7 @@ ScheduledTasks = Scheduled tasks
OneDriveUninstalling = Uninstalling OneDrive...
OneDriveInstalling = Installing OneDrive...
OneDriveDownloading = Downloading OneDrive... ~33 MB
OneDriveWarning = The "{0}" function will be applied only if the preset is configured to remove OneDrive, otherwise the backup functionality for the "Desktop" and "Pictures" folders in OneDrive breaks
WindowsFeaturesTitle = Windows features
OptionalFeaturesTitle = Optional features
EnableHardwareVT = Enable Virtualization in UEFI
@ -74,7 +75,7 @@ Run = Run
SelectAll = Select all
Skip = Skip
Skipped = Skipped
FileExplorerRestartPrompt = Sometimes in order for the changes to take effect the File Explorer process has to be restarted
FileExplorerRestartPrompt = \nSometimes in order for the changes to take effect the File Explorer process has to be restarted
TelegramGroupTitle = Join our official Telegram group
TelegramChannelTitle = Join our official Telegram channel
Uninstall = Uninstall

3
Sophia Script/Sophia Script for Windows 10/Localizations/es-ES/Sophia.psd1

@ -14,6 +14,7 @@ ScheduledTasks = Tareas programadas
OneDriveUninstalling = Desinstalar OneDrive...
OneDriveInstalling = Instalación de OneDrive...
OneDriveDownloading = Descargando OneDrive... ~33 MB
OneDriveWarning = La función "{0}" se aplicará sólo si el preajuste está configurado para eliminar OneDrive, de lo contrario la funcionalidad de copia de seguridad para las carpetas "Escritorio" e "Imágenes" en OneDrive se rompe
WindowsFeaturesTitle = Características de Windows
OptionalFeaturesTitle = Características opcionales
EnableHardwareVT = Habilitar la virtualización en UEFI
@ -74,7 +75,7 @@ Run = Iniciar
SelectAll = Seleccionar todo
Skip = Omitir
Skipped = Omitido
FileExplorerRestartPrompt = A veces, para que los cambios surtan efecto, hay que reiniciar el proceso del Explorador de archivos
FileExplorerRestartPrompt = \nA veces, para que los cambios surtan efecto, hay que reiniciar el proceso del Explorador de archivos
TelegramGroupTitle = Únete a nuestro grupo oficial de Telegram
TelegramChannelTitle = Únete a nuestro canal oficial de Telegram
Uninstall = Desinstalar

3
Sophia Script/Sophia Script for Windows 10/Localizations/fr-FR/Sophia.psd1

@ -14,6 +14,7 @@ ScheduledTasks = Tâches planifiées
OneDriveUninstalling = Désinstalltion de OneDrive...
OneDriveInstalling = Installation de OneDrive...
OneDriveDownloading = Téléchargement de OneDrive... ~33 Mo
OneDriveWarning = La fonction "{0}" sera appliquée uniquement si le préréglage est configuré pour supprimer OneDrive, sinon la fonctionnalité de sauvegarde des dossiers "Desktop" et "Pictures" dans OneDrive s'interrompt.
WindowsFeaturesTitle = Fonctionnalités
OptionalFeaturesTitle = Fonctionnalités optionnelles
EnableHardwareVT = Activer la virtualisation dans UEFI
@ -74,7 +75,7 @@ Run = Démarrer
SelectAll = Tout sélectionner
Skip = Passer
Skipped = Passé
FileExplorerRestartPrompt = Parfois, pour que les modifications soient prises en compte, il faut redémarrer l'Explorateur de fichiers
FileExplorerRestartPrompt = \nParfois, pour que les modifications soient prises en compte, il faut redémarrer l'Explorateur de fichiers
TelegramGroupTitle = Rejoignez notre groupe Telegram officiel
TelegramChannelTitle = Rejoignez notre canal Telegram officiel
Uninstall = Désinstaller

3
Sophia Script/Sophia Script for Windows 10/Localizations/hu-HU/Sophia.psd1

@ -14,6 +14,7 @@ ScheduledTasks = Ütemezett feladatok
OneDriveUninstalling = OneDrive eltávolítása...
OneDriveInstalling = OneDrive telepítése...
OneDriveDownloading = OneDrive letöltése... ~33 MB
OneDriveWarning = A "{0}" funkció csak akkor kerül alkalmazásra, ha az előbeállítás a OneDrive eltávolítására van beállítva, különben a OneDrive "Desktop" és "Pictures" mappáinak biztonsági mentési funkciója megszakad.
WindowsFeaturesTitle = Windows szolgáltatások
OptionalFeaturesTitle = Opcionális szolgáltatások
EnableHardwareVT = Virtualizáció engedélyezése UEFI-ben
@ -74,7 +75,7 @@ Run = Futtatás
SelectAll = Összes kijelölése
Skip = Átugrás
Skipped = Átugorva
FileExplorerRestartPrompt = Néha ahhoz, hogy a módosítások hatályba lépjenek, a File Explorer folyamatot újra kell indítani
FileExplorerRestartPrompt = \nNéha ahhoz, hogy a módosítások hatályba lépjenek, a File Explorer folyamatot újra kell indítani
TelegramGroupTitle = Pridružite se našoj službenoj grupi Telegram
TelegramChannelTitle = Pridružite se našem službenom kanalu Telegram
Uninstall = Eltávolít

3
Sophia Script/Sophia Script for Windows 10/Localizations/it-IT/Sophia.psd1

@ -14,6 +14,7 @@ ScheduledTasks = Attività pianificate
OneDriveUninstalling = Disinstalla OneDrive...
OneDriveInstalling = Installazione di OneDrive...
OneDriveDownloading = Download di OneDrive... ~33 MB
OneDriveWarning = La funzione "{0}" sarà applicata solo se il preset è configurato per rimuovere OneDrive, altrimenti la funzionalità di backup per le cartelle "Desktop" e "Pictures" in OneDrive si interrompe
WindowsFeaturesTitle = Funzionalità di Windows
OptionalFeaturesTitle = Caratteristiche opzionali
EnableHardwareVT = Abilita virtualizzazione in UEFI
@ -74,7 +75,7 @@ Run = Eseguire
SelectAll = Seleziona tutto
Skip = Salta
Skipped = Saltato
FileExplorerRestartPrompt = A volte, affinché le modifiche abbiano effetto, il processo di File Explorer deve essere riavviato
FileExplorerRestartPrompt = \nA volte, affinché le modifiche abbiano effetto, il processo di File Explorer deve essere riavviato
TelegramGroupTitle = Unisciti al nostro gruppo ufficiale Telegram
TelegramChannelTitle = Unisciti al nostro canale ufficiale di Telegram
Uninstall = Disinstallare

3
Sophia Script/Sophia Script for Windows 10/Localizations/pt-BR/Sophia.psd1

@ -14,6 +14,7 @@ ScheduledTasks = Tarefas agendadas
OneDriveUninstalling = Desinstalar OneDrive...
OneDriveInstalling = Instalar o OneDrive...
OneDriveDownloading = Baixando OneDrive... ~33 MB
OneDriveWarning = A função "{0}" será aplicada somente se a predefinição for configurada para remover o OneDrive, caso contrário a funcionalidade de backup para as pastas "Desktop" e "Pictures" no OneDrive quebra
WindowsFeaturesTitle = Recursos do Windows
OptionalFeaturesTitle = Recursos opcionais
EnableHardwareVT = Habilitar virtualização em UEFI
@ -74,7 +75,7 @@ Run = Executar
SelectAll = Selecionar tudo
Skip = Pular
Skipped = Ignorados
FileExplorerRestartPrompt = Por vezes, para que as alterações tenham efeito, o processo File Explorer tem de ser reiniciado
FileExplorerRestartPrompt = \nPor vezes, para que as alterações tenham efeito, o processo File Explorer tem de ser reiniciado
TelegramGroupTitle = Entre no grupo oficial do Telegram
TelegramChannelTitle = Entre no canal oficial do Telegram
Uninstall = Desinstalar

3
Sophia Script/Sophia Script for Windows 10/Localizations/ru-RU/Sophia.psd1

@ -14,6 +14,7 @@ ScheduledTasks = Запланированные за
OneDriveUninstalling = Удаление OneDrive...
OneDriveInstalling = OneDrive устанавливается...
OneDriveDownloading = Скачивается OneDrive... ~33 МБ
OneDriveWarning = Функция "{0}" будет применена только в случае, если в пресете настроено удаление приложения OneDrive, иначе ломается функционал резервного копирования для папок "Рабочий стол" и "Изображения" в OneDrive
WindowsFeaturesTitle = Компоненты Windows
OptionalFeaturesTitle = Дополнительные компоненты
EnableHardwareVT = Включите виртуализацию в UEFI
@ -74,7 +75,7 @@ Run = Запустить
SelectAll = Выбрать всё
Skip = Пропустить
Skipped = Пропущено
FileExplorerRestartPrompt = Иногда для того, чтобы изменения вступили в силу, процесс проводника необходимо перезапустить
FileExplorerRestartPrompt = \nИногда для того, чтобы изменения вступили в силу, процесс проводника необходимо перезапустить
TelegramGroupTitle = Присоединяйтесь к нашей официальной группе в Telegram
TelegramChannelTitle = Присоединяйтесь к нашему официальному каналу в Telegram
Uninstall = Удалить

7
Sophia Script/Sophia Script for Windows 10/Localizations/tr-TR/Sophia.psd1

@ -14,8 +14,9 @@ ScheduledTasks = Zamanlanan görevler
OneDriveUninstalling = OneDrive kaldırılıyor...
OneDriveInstalling = OneDrive kuruluyor...
OneDriveDownloading = OneDrive indiriliyor... ~33 MB
WindowsFeaturesTitle = Windows özellikleri
OptionalFeaturesTitle = İsteğe bağlı özellikler
OneDriveWarning = "{0}" işlevi yalnızca ön ayar OneDrive'ı kaldıracak şekilde yapılandırılırsa uygulanır, aksi takdirde OneDrive'daki "Masaüstü" ve "Resimler" klasörleri için yedekleme işlevi bozulur
WindowsFeaturesTitle = Características do Windows
OptionalFeaturesTitle = Opsiyonel özellikler
EnableHardwareVT = UEFI'dan sanallaştırmayı aktifleştirin
UserShellFolderNotEmpty = "{0}" klasöründe bazı dosyalar kaldı. \nKendiniz yeni konuma taşıyın
RetrievingDrivesList = Sürücü listesi alınıyor...
@ -74,7 +75,7 @@ Run = Başlat
SelectAll = Hepsini seç
Skip = Atla
Skipped = Atlandı
FileExplorerRestartPrompt = Bazen değişikliklerin geçerli olması için Dosya Gezgini işleminin yeniden başlatılması gerekir
FileExplorerRestartPrompt = \nBazen değişikliklerin geçerli olması için Dosya Gezgini işleminin yeniden başlatılması gerekir
TelegramGroupTitle = Resmi Telegram grubumuza katılın
TelegramChannelTitle = Resmi Telegram kanalımıza katılın
Uninstall = Kaldır

3
Sophia Script/Sophia Script for Windows 10/Localizations/uk-UA/Sophia.psd1

@ -14,6 +14,7 @@ ScheduledTasks = Заплановані задачі
OneDriveUninstalling = Видалення OneDrive...
OneDriveInstalling = OneDrive встановлюється...
OneDriveDownloading = Завантажується OneDrive... ~33 МБ
OneDriveWarning = Функція "{0}" буде застосована тільки в разі, якщо в пресете налаштоване щоб видалити програму OneDrive, інакше ламається функціонал резервного копіювання для папок "Робочий стіл" і "Зображення" в OneDrive
WindowsFeaturesTitle = Компоненти Windows
OptionalFeaturesTitle = Додаткові компоненти
EnableHardwareVT = Увімкніть віртуалізацію в UEFI
@ -74,7 +75,7 @@ Run = Запустити
SelectAll = Вибрати все
Skip = Пропустити
Skipped = Пропущено
FileExplorerRestartPrompt = Іноді для того, щоб зміни вступили в силу, процес провідника необхідно перезапустити
FileExplorerRestartPrompt = \nІноді для того, щоб зміни вступили в силу, процес провідника необхідно перезапустити
TelegramGroupTitle = Приєднуйтесь до нашої офіційної групи в Telegram
TelegramChannelTitle = Приєднуйтесь до нашого офіційного каналу в Telegram
Uninstall = Видалити

3
Sophia Script/Sophia Script for Windows 10/Localizations/zh-CN/Sophia.psd1

@ -14,6 +14,7 @@ ScheduledTasks = 计划任务
OneDriveUninstalling = 卸载OneDrive
OneDriveInstalling = OneDrive正在安装
OneDriveDownloading = 正在下载OneDrive ~33 MB
OneDriveWarning = 只有当预设被配置为删除OneDrive时才会应用"{0}"功能否则OneDrive中的 "桌面 " "图片 "文件夹的备份功能就会中断
WindowsFeaturesTitle = Windows功能
OptionalFeaturesTitle = 可选功能
EnableHardwareVT = UEFI中开启虚拟化
@ -74,7 +75,7 @@ Run = 运行
SelectAll = 全选
Skip = 跳过
Skipped = 已跳过
FileExplorerRestartPrompt = 有时为了使更改生效必须重新启动文件管理器进程
FileExplorerRestartPrompt = \n有时为了使更改生效必须重新启动文件管理器进程
TelegramGroupTitle = 加入我们的官方Telegram
TelegramChannelTitle = 加入我们的官方Telegram 频道
Uninstall = 卸载

4
Sophia Script/Sophia Script for Windows 10/Manifest/Sophia.psd1

@ -1,9 +1,9 @@
@{
RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '5.12.4'
ModuleVersion = '5.12.5'
GUID = '109cc881-c42b-45af-a74a-550781989d6a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 20142021 farag & Inestic. All rights reserved'
Copyright = '(c) 20142021 farag & Inestic. All rights reserved'
Description = 'Module for Windows fine-tuning and automating the routine tasks'
PowerShellVersion = '5.1'
ProcessorArchitecture = 'AMD64'

155
Sophia Script/Sophia Script for Windows 10/Module/Sophia.psm1

@ -2,11 +2,11 @@
.SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v5.12.4
Date: 05.10.2021
Version: v5.12.5
Date: 24.10.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -579,39 +579,30 @@ function ScheduledTasks
# The following tasks will have their checkboxes checked
[string[]]$CheckedScheduledTasks = @(
# Collects program telemetry information if opted-in to the Microsoft Customer Experience Improvement Program
# Сбор телеметрических данных программы при участии в программе улучшения качества ПО
"ProgramDataUpdater",
# This task collects and uploads autochk SQM data if opted-in to the Microsoft Customer Experience Improvement Program
# Эта задача собирает и загружает данные SQM при участии в программе улучшения качества программного обеспечения
"Proxy",
# If the user has consented to participate in the Windows Customer Experience Improvement Program, this job collects and sends usage data to Microsoft
# Если пользователь изъявил желание участвовать в программе по улучшению качества программного обеспечения Windows, эта задача будет собирать и отправлять сведения о работе программного обеспечения в Майкрософт
"Consolidator",
# The USB CEIP (Customer Experience Improvement Program) task collects Universal Serial Bus related statistics and information about your machine and sends it to the Windows Device Connectivity engineering group at Microsoft
# При выполнении задачи программы улучшения качества ПО шины USB (USB CEIP) осуществляется сбор статистических данных об использовании универсальной последовательной шины USB и с ведений о компьютере, которые направляются инженерной группе Майкрософт по вопросам подключения устройств в Windows
"UsbCeip",
# The Windows Disk Diagnostic reports general disk and system information to Microsoft for users participating in the Customer Experience Program
# Для пользователей, участвующих в программе контроля качества программного обеспечения, служба диагностики дисков Windows предоставляет общие сведения о дисках и системе в корпорацию Майкрософт
"Microsoft-Windows-DiskDiagnosticDataCollector",
# This task shows various Map related toasts
# Эта задача показывает различные тосты (всплывающие уведомления) приложения "Карты"
"MapsToastTask",
# This task checks for updates to maps which you have downloaded for offline use
# Эта задача проверяет наличие обновлений для карт, загруженных для автономного использования
"MapsUpdateTask",
# Initializes Family Safety monitoring and enforcement
# Инициализация контроля и применения правил семейной безопасности
"FamilySafetyMonitor",
# Synchronizes the latest settings with the Microsoft family features service
# Синхронизирует последние параметры со службой функций семьи учетных записей Майкрософт
"FamilySafetyRefreshTask",
# XblGameSave Standby Task
@ -845,7 +836,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Add-Type @SetForegroundWindow
}
Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -match "Sophia Script for Windows 10"} | ForEach-Object -Process {
Get-Process | Where-Object -FilterScript {(($_.ProcessName -eq "powershell") -or ($_.ProcessName -eq "WindowsTerminal")) -and ($_.MainWindowTitle -match "Sophia Script for Windows 10")} | ForEach-Object -Process {
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
@ -3522,7 +3513,7 @@ public static bool MarkFileDelete (string sourcefile)
"@
}
# If there are some files or folders left in %LOCALAPPDATA\Temp%
# 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]))
@ -3686,6 +3677,9 @@ public static bool MarkFileDelete (string sourcefile)
}
}
# Save screenshots by pressing Win+PrtScr in the Pictures folder
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{B7BEDE81-DF94-4682-A7D8-57A52620B86F}" -Force -ErrorAction Ignore
Get-ScheduledTask -TaskName "Onedrive* Update*" | Enable-ScheduledTask
Get-ScheduledTask -TaskName "Onedrive* Update*" | Start-ScheduledTask
}
@ -3757,56 +3751,56 @@ function StorageSense
<#
.SYNOPSIS
Clean up of temporary files
Storage Sense running frequency
.PARAMETER Enable
Delete temporary files that apps aren't using
.PARAMETER Month
Run Storage Sense every month
.PARAMETER Disable
Do not delete temporary files that apps aren't using
.PARAMETER Default
Run Storage Sense during low free disk space
.EXAMPLE
StorageSenseTempFiles -Enable
StorageSenseFrequency -Month
.EXAMPLE
StorageSenseTempFiles -Disable
StorageSenseFrequency -Default
.NOTES
Current user
#>
function StorageSenseTempFiles
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 04 -PropertyType DWord -Value 1 -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 04 -PropertyType DWord -Value 0 -Force
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 2048 -PropertyType DWord -Value 0 -Force
}
}
}
@ -3814,56 +3808,56 @@ function StorageSenseTempFiles
<#
.SYNOPSIS
Storage Sense running frequency
Clean up of temporary files
.PARAMETER Month
Run Storage Sense every month
.PARAMETER Enable
Delete temporary files that apps aren't using
.PARAMETER Default
Run Storage Sense during low free disk space
.PARAMETER Disable
Do not delete temporary files that apps aren't using
.EXAMPLE
StorageSenseFrequency -Month
StorageSenseTempFiles -Enable
.EXAMPLE
StorageSenseFrequency -Default
StorageSenseTempFiles -Disable
.NOTES
Current user
#>
function StorageSenseFrequency
function StorageSenseTempFiles
{
param
(
[Parameter(
Mandatory = $true,
ParameterSetName = "Month"
ParameterSetName = "Enable"
)]
[switch]
$Month,
$Enable,
[Parameter(
Mandatory = $true,
ParameterSetName = "Default"
ParameterSetName = "Disable"
)]
[switch]
$Default
$Disable
)
switch ($PSCmdlet.ParameterSetName)
{
"Month"
"Enable"
{
if ((Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01) -eq "1")
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 2048 -PropertyType DWord -Value 30 -Force
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 04 -PropertyType DWord -Value 1 -Force
}
}
"Default"
"Disable"
{
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 0 -Force
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 04 -PropertyType DWord -Value 0 -Force
}
}
}
@ -4061,6 +4055,7 @@ Unregister-ScheduledTask -TaskName SymbolicLink -Confirm:`$false
#region main
# Change the %TEMP% environment variable path to %LOCALAPPDATA%\Temp
# The additional registry key creating are needed to fix the property type of the keys: SetEnvironmentVariable creates them with the "String" type instead of "ExpandString" as by default
[Environment]::SetEnvironmentVariable("TMP", "$env:SystemDrive\Temp", "User")
[Environment]::SetEnvironmentVariable("TMP", "$env:SystemDrive\Temp", "Machine")
[Environment]::SetEnvironmentVariable("TMP", "$env:SystemDrive\Temp", "Process")
@ -4605,7 +4600,6 @@ function WindowsFeatures
# The following Windows features will have their checkboxes checked
[string[]]$CheckedFeatures = @(
# Legacy Components
# Компоненты прежних версий
"LegacyComponents",
# PowerShell 2.0
@ -4613,11 +4607,9 @@ function WindowsFeatures
"MicrosoftWindowsPowershellV2Root",
# Microsoft XPS Document Writer
# Средство записи XPS-документов (Microsoft)
"Printing-XPSServices-Features",
# Work Folders Client
# Клиент рабочих папок
"WorkFolders-Client"
)
@ -4855,7 +4847,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Add-Type @SetForegroundWindow
}
Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -match "Sophia Script for Windows 10"} | ForEach-Object -Process {
Get-Process | Where-Object -FilterScript {(($_.ProcessName -eq "powershell") -or ($_.ProcessName -eq "WindowsTerminal")) -and ($_.MainWindowTitle -match "Sophia Script for Windows 10")} | ForEach-Object -Process {
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
@ -4932,11 +4924,9 @@ function WindowsCapabilities
# The following optional features will have their checkboxes checked
[string[]]$CheckedCapabilities = @(
# Steps Recorder
# Средство записи действий
"App.StepsRecorder*",
# Microsoft Quick Assist
# Быстрая поддержка (Майкрософт)
"App.Support.QuickAssist*",
# Microsoft Paint
@ -4952,7 +4942,6 @@ function WindowsCapabilities
"Browser.InternetExplorer*",
# Math Recognizer
# Распознаватель математических знаков
"MathRecognizer*",
# Windows Media Player
@ -4960,38 +4949,30 @@ function WindowsCapabilities
"Media.WindowsMediaPlayer*",
# OpenSSH Client
# Клиент OpenSSH
"OpenSSH.Client*"
)
# The following optional features will be excluded from the display
[string[]]$ExcludedCapabilities = @(
# The DirectX Database to configure and optimize apps when multiple Graphics Adapters are present
# База данных DirectX для настройки и оптимизации приложений при наличии нескольких графических адаптеров
"DirectX.Configuration.Database*",
# Language components
# Языковые компоненты
"Language.*",
# Notepad
# Блокнот
"Microsoft.Windows.Notepad*",
# Mail, contacts, and calendar sync component
# Компонент синхронизации почты, контактов и календаря
"OneCoreUAP.OneSync*",
# Windows PowerShell Intergrated Scripting Enviroment
# Интегрированная среда сценариев Windows PowerShell
"Microsoft.Windows.PowerShell.ISE*",
# Management of printers, printer drivers, and printer servers
# Управление принтерами, драйверами принтеров и принт-серверами
"Print.Management.Console*",
# Features critical to Windows functionality
# Компоненты, критичные для работоспособности Windows
"Windows.Client.ShellComponents*"
)
#endregion Variables
@ -5254,7 +5235,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Add-Type @SetForegroundWindow
}
Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -match "Sophia Script for Windows 10"} | ForEach-Object -Process {
Get-Process | Where-Object -FilterScript {(($_.ProcessName -eq "powershell") -or ($_.ProcessName -eq "WindowsTerminal")) -and ($_.MainWindowTitle -match "Sophia Script for Windows 10")} | ForEach-Object -Process {
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
@ -5327,7 +5308,7 @@ function UpdateMicrosoftProducts
}
"Disable"
{
if ((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"})
if (((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"}).IsDefaultAUService -eq $true)
{
(New-Object -ComObject Microsoft.Update.ServiceManager).RemoveService("7971f918-a847-4430-9279-4a52d1efe18d")
}
@ -5582,14 +5563,14 @@ function IPv6Component
{
if ($null -eq $IPv6Test)
{
Disable-NetAdapterBinding Name * ComponentID ms_tcpip6
Disable-NetAdapterBinding -Name * -ComponentID ms_tcpip6
}
}
"Enable"
{
if ($IPv6Test)
{
Enable-NetAdapterBinding Name * ComponentID ms_tcpip6
Enable-NetAdapterBinding -Name * -ComponentID ms_tcpip6
}
}
}
@ -6662,6 +6643,10 @@ public static string GetString(uint strId)
.EXAMPLE
WinPrtScrFolder -Default
.NOTES
The function will be applied only if the preset is configured to remove OneDrive,
otherwise the backup functionality for the "Desktop" and "Pictures" folders in OneDrive breaks
.NOTES
Current user
#>
@ -6688,8 +6673,16 @@ function WinPrtScrFolder
{
"Desktop"
{
$DesktopFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name Desktop
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{B7BEDE81-DF94-4682-A7D8-57A52620B86F}" -Type ExpandString -Value $DesktopFolder -Force
if ((Get-Content -Path $PSScriptRoot\..\Sophia.ps1 -Encoding UTF8 -Force | Select-String -SimpleMatch "OneDrive -Uninstall").Line.StartsWith("#") -eq $false)
{
$DesktopFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name Desktop
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{B7BEDE81-DF94-4682-A7D8-57A52620B86F}" -Type ExpandString -Value $DesktopFolder -Force
}
else
{
Write-Warning -Message ($Localization.OneDriveWarning -f $MyInvocation.Line)
Write-Error -Message ($Localization.OneDriveWarning -f $MyInvocation.Line) -ErrorAction SilentlyContinue
}
}
"Default"
{
@ -8229,7 +8222,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Add-Type @SetForegroundWindow
}
Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -match "Sophia Script for Windows 11"} | ForEach-Object -Process {
Get-Process | Where-Object -FilterScript {(($_.ProcessName -eq "powershell") -or ($_.ProcessName -eq "WindowsTerminal")) -and ($_.MainWindowTitle -match "Sophia Script for Windows 10")} | ForEach-Object -Process {
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
@ -9127,7 +9120,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Add-Type @SetForegroundWindow
}
Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -match "Sophia Script for Windows 10"} | ForEach-Object -Process {
Get-Process | Where-Object -FilterScript {(($_.ProcessName -eq "powershell") -or ($_.ProcessName -eq "WindowsTerminal")) -and ($_.MainWindowTitle -match "Sophia Script for Windows 10")} | ForEach-Object -Process {
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
@ -9447,7 +9440,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Add-Type @SetForegroundWindow
}
Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -match "Sophia Script for Windows 10"} | ForEach-Object -Process {
Get-Process | Where-Object -FilterScript {(($_.ProcessName -eq "powershell") -or ($_.ProcessName -eq "WindowsTerminal")) -and ($_.MainWindowTitle -match "Sophia Script for Windows 10")} | ForEach-Object -Process {
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
@ -10295,8 +10288,8 @@ while (`$true)
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel" -Name ShowInActionCenter -Force -ErrorAction Ignore
Unregister-ScheduledTask -TaskName "Windows Cleanup" -Confirm:$false
Unregister-ScheduledTask -TaskName "Windows Cleanup Notification" -Confirm:$false
Unregister-ScheduledTask -TaskName "Windows Cleanup" -Confirm:$false -ErrorAction Ignore
Unregister-ScheduledTask -TaskName "Windows Cleanup Notification" -Confirm:$false -ErrorAction Ignore
Remove-Item -Path Registry::HKEY_CLASSES_ROOT\WindowsCleanup -Recurse -Force -ErrorAction Ignore
}
@ -10403,7 +10396,7 @@ Get-ChildItem -Path `$env:SystemRoot\SoftwareDistribution\Download -Recurse -For
}
"Delete"
{
Unregister-ScheduledTask -TaskName SoftwareDistribution -Confirm:$false
Unregister-ScheduledTask -TaskName SoftwareDistribution -Confirm:$false -ErrorAction Ignore
}
}
}
@ -10500,7 +10493,7 @@ Get-ChildItem -Path `$env:TEMP -Recurse -Force | Where-Object {`$_.CreationTime
}
"Delete"
{
Unregister-ScheduledTask -TaskName Temp -Confirm:$false
Unregister-ScheduledTask -TaskName Temp -Confirm:$false -ErrorAction Ignore
}
}
}
@ -11359,18 +11352,18 @@ function CABInstallContext
{
"Show"
{
if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs\Command))
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
New-Item -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\runas\Command -Force
}
$Value = "{0}" -f "cmd /c DISM.exe /Online /Add-Package /PackagePath:`"%1`" /NoRestart & pause"
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs\Command -Name "(default)" -PropertyType String -Value $Value -Force
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
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\runas\Command -Name "(default)" -PropertyType String -Value $Value -Force
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 Ignore
Remove-Item -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\runas -Recurse -Force -ErrorAction Ignore
}
}
}

51
Sophia Script/Sophia Script for Windows 10/Sophia.ps1

@ -2,11 +2,11 @@
.SYNOPSIS
Default preset file for "Sophia Script for Windows 10"
Version: v5.12.4
Date: 05.10.2021
Version: v5.12.5
Date: 24.10.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -72,7 +72,7 @@ param
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.4 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 20142021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.5 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force
@ -566,14 +566,6 @@ StorageSense -Enable
# Выключить Контроль памяти (значение по умолчанию)
# StorageSense -Disable
# Delete temporary files that apps aren't using
# Удалять временные файлы, не используемые в приложениях
StorageSenseTempFiles -Enable
# Do not delete temporary files that apps aren't using
# Не удалять временные файлы, не используемые в приложениях
# StorageSenseTempFiles -Disable
# Run Storage Sense every month
# Запускать Контроль памяти каждый месяц
StorageSenseFrequency -Month
@ -581,6 +573,14 @@ StorageSenseFrequency -Month
# Run Storage Sense during low free disk space (default value)
# Запускать Контроль памяти, когда остается мало место на диске (значение по умолчанию)
# StorageSenseFrequency -Default
# Delete temporary files that apps aren't using
# Удалять временные файлы, не используемые в приложениях
StorageSenseTempFiles -Enable
# Do not delete temporary files that apps aren't using
# Не удалять временные файлы, не используемые в приложениях
# StorageSenseTempFiles -Disable
#endregion StorageSense
# Disable hibernation. Do not recommend turning it off on laptops
@ -777,11 +777,18 @@ SetUserShellFolderLocation -Root
#>
# SetUserShellFolderLocation -Default
# Save screenshots by pressing Win+PrtScr on the Desktop
# Сохранять скриншоты по нажатию Win+PrtScr на рабочий столе
<#
Save screenshots by pressing Win+PrtScr on the Desktop
The function will be applied only if the preset is configured to remove the OneDrive application
Otherwise the backup functionality for the "Desktop" and "Pictures" folders in OneDrive breaks
Сохранять скриншоты по нажатию Win+PrtScr на рабочий столе
Функция будет применена только в случае, если в пресете настроено удаление приложения OneDrive,
иначе ломается функционал резервного копирования для папок "Рабочий стол" и "Изображения" в OneDrive
#>
WinPrtScrFolder -Desktop
# Save screenshots by pressing Win+PrtScr on the Pictures folder (default value)
# Save screenshots by pressing Win+PrtScr in the Pictures folder (default value)
# Cохранять скриншоты по нажатию Win+PrtScr в папку "Изображения" (значение по умолчанию)
# WinPrtScrFolder -Default
@ -835,14 +842,14 @@ NumLock -Enable
# Выключить Num Lock при загрузке (значение по умолчанию)
# NumLock -Disable
# Enable Caps Lock
# Включить Caps Lock
# CapsLock -Enable
# Disable Caps Lock (default value)
# Выключить Caps Lock (значение по умолчанию)
# Disable Caps Lock
# Выключить Caps Lock
# CapsLock -Disable
# Enable Caps Lock (default value)
# Включить Caps Lock (значение по умолчанию)
# CapsLock -Enable
# Turn off pressing the Shift key 5 times to turn Sticky keys
# Выключить залипание клавиши Shift после 5 нажатий
StickyShift -Disable

Loading…
Cancel
Save