Browse Source

02.06.2021 v5.10.6

pull/197/head
Dmitry Nefedov 4 years ago
committed by GitHub
parent
commit
ecdc8dc66d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      Sophia/PowerShell 7/Functions.ps1
  2. 5
      Sophia/PowerShell 7/Localizations/cn-CN/Sophia.psd1
  3. 5
      Sophia/PowerShell 7/Localizations/de-DE/Sophia.psd1
  4. 3
      Sophia/PowerShell 7/Localizations/en-US/Sophia.psd1
  5. 3
      Sophia/PowerShell 7/Localizations/es-ES/Sophia.psd1
  6. 17
      Sophia/PowerShell 7/Localizations/fr-FR/Sophia.psd1
  7. 3
      Sophia/PowerShell 7/Localizations/hu-HU/Sophia.psd1
  8. 3
      Sophia/PowerShell 7/Localizations/it-IT/Sophia.psd1
  9. 3
      Sophia/PowerShell 7/Localizations/pt-BR/Sophia.psd1
  10. 3
      Sophia/PowerShell 7/Localizations/ru-RU/Sophia.psd1
  11. 3
      Sophia/PowerShell 7/Localizations/tr-TR/Sophia.psd1
  12. 3
      Sophia/PowerShell 7/Localizations/uk-UA/Sophia.psd1
  13. 86
      Sophia/PowerShell 7/Sophia.ps1
  14. 4
      Sophia/PowerShell 7/Sophia.psd1
  15. 529
      Sophia/PowerShell 7/Sophia.psm1

10
Sophia/PowerShell 7/Functions.ps1

@ -2,8 +2,8 @@
.SYNOPSIS .SYNOPSIS
The TAB completion for functions and their arguments The TAB completion for functions and their arguments
Version: v5.10.5 Version: v5.10.6
Date: 17.05.2021 Date: 01.06.2021
Copyright (c) 20142021 farag Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & oZ-Zo Copyright (c) 20192021 farag & oZ-Zo
@ -53,7 +53,7 @@ function Sophia
$Functions $Functions
) )
# Regardless of the functions entered as an argument, the "Checkings" function will be executed first, and the "Refresh" and "Errors" functions will be executed at the end # 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} Invoke-Command -ScriptBlock {Checkings}
foreach ($Function in $Functions) foreach ($Function in $Functions)
@ -61,12 +61,12 @@ function Sophia
Invoke-Expression -Command $Function Invoke-Expression -Command $Function
} }
Invoke-Command -ScriptBlock {Refresh; Errors} Invoke-Command -ScriptBlock {RefreshEnvironment; Errors}
} }
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script v5.10.5 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & oz-zo, 2014–2021" $Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script v5.10.6 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & oz-zo, 2014–2021"
Remove-Module -Name Sophia -Force -ErrorAction Ignore Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Sophia.psd1 -PassThru -Force Import-Module -Name $PSScriptRoot\Sophia.psd1 -PassThru -Force

5
Sophia/PowerShell 7/Localizations/cn-CN/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = 该脚本仅支持Windows 10 x64 UnsupportedOSBitness = 该脚本仅支持Windows 10 x64
UnsupportedOSBuild = 该脚本支持Windows 10版本2004/20H2/20H1和更高版本 UnsupportedOSBuild = 该脚本支持Windows 10版本2004/20H2/21H1和更高版本
UnsupportedISE = 该脚本不支持通过Windows PowerShell ISE运行
UnsupportedRelease = 找到新版本 UnsupportedRelease = 找到新版本
CustomizationWarning = \n在运行Sophia Script之前您是否已自定义Sophia.ps1预设文件中的每个功能 CustomizationWarning = \n在运行Sophia Script之前您是否已自定义Sophia.ps1预设文件中的每个功能
ControlledFolderAccessDisabled = 受控文件夹访问禁用 ControlledFolderAccessDisabled = 受控文件夹访问禁用

5
Sophia/PowerShell 7/Localizations/de-DE/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Das Skript unterstützt nur Windows 10 x64 UnsupportedOSBitness = Das Skript unterstützt nur Windows 10 x64
UnsupportedOSBuild = Das Skript unterstützt Windows 10 2004/20H2/20H1-Versionen und höher UnsupportedOSBuild = Das Skript unterstützt Windows 10 2004/20H2/21H1-Versionen und höher
UnsupportedISE = Das Skript unterstützt nicht die Ausführung über Windows PowerShell ISE
UnsupportedRelease = Neue Version gefunden UnsupportedRelease = Neue Version gefunden
CustomizationWarning = \nHaben Sie alle Funktionen in der voreingestellten Datei Sophia.ps1 angepasst, bevor Sie Sophia Script ausführen? CustomizationWarning = \nHaben Sie alle Funktionen in der voreingestellten Datei Sophia.ps1 angepasst, bevor Sie Sophia Script ausführen?
ControlledFolderAccessDisabled = Kontrollierter Ordnerzugriff deaktiviert ControlledFolderAccessDisabled = Kontrollierter Ordnerzugriff deaktiviert

3
Sophia/PowerShell 7/Localizations/en-US/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = The script supports Windows 10 x64 only UnsupportedOSBitness = The script supports Windows 10 x64 only
UnsupportedOSBuild = The script supports Windows 10 2004/20H2/21H1 versions and higher UnsupportedOSBuild = The script supports Windows 10 2004/20H2/21H1 versions and higher
UnsupportedISE = The script doesn't support running via Windows PowerShell ISE
UnsupportedRelease = A new version found UnsupportedRelease = A new version found
CustomizationWarning = \nHave you customized every function in the Sophia.ps1 preset file before running Sophia Script? CustomizationWarning = \nHave you customized every function in the Sophia.ps1 preset file before running Sophia Script?
ControlledFolderAccessDisabled = Controlled folder access disabled ControlledFolderAccessDisabled = Controlled folder access disabled

3
Sophia/PowerShell 7/Localizations/es-ES/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = El script sólo es compatible con Windows 10 x64 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 UnsupportedOSBuild = El script es compatible con versión Windows 10 2004/20H2/21H1 y superiores
UnsupportedISE = El script no es compatible con la ejecución a través de Windows PowerShell ISE
UnsupportedRelease = Nueva versión encontrada UnsupportedRelease = Nueva versión encontrada
CustomizationWarning = \n¿Ha personalizado todas las funciones del archivo predeterminado Sophia.ps1 antes de ejecutar Sophia Script? CustomizationWarning = \n¿Ha personalizado todas las funciones del archivo predeterminado Sophia.ps1 antes de ejecutar Sophia Script?
ControlledFolderAccessDisabled = Acceso a la carpeta controlada deshabilitado ControlledFolderAccessDisabled = Acceso a la carpeta controlada deshabilitado

17
Sophia/PowerShell 7/Localizations/fr-FR/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Le script supporte uniquement Windows 10 x64 UnsupportedOSBitness = Le script supporte uniquement Windows 10 x64
UnsupportedOSBuild = Le script supporte les versions Windows 10 2004/20H2/20H1 et ultérieures UnsupportedOSBuild = Le script supporte les versions Windows 10 2004/20H2/21H1 et ultérieures
UnsupportedISE = Le script ne supporte pas l'exécution via Windows PowerShell ISE
UnsupportedRelease = Nouvelle version trouvée 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? 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é ControlledFolderAccessDisabled = Contrôle d'accès aux dossiers désactivé
@ -13,10 +14,10 @@ OptionalFeaturesTitle = Fonctionnalités optionnelles
EnableHardwareVT = Activer la virtualisation dans UEFI EnableHardwareVT = Activer la virtualisation dans UEFI
UserShellFolderNotEmpty = Certains fichiers laissés dans le dossier "{0}" \nDéplacer les manuellement vers un nouvel emplacement UserShellFolderNotEmpty = Certains fichiers laissés dans le dossier "{0}" \nDéplacer les manuellement vers un nouvel emplacement
RetrievingDrivesList = Récupération de la liste des lecteurs... RetrievingDrivesList = Récupération de la liste des lecteurs...
DriveSelect = Seleccione la unidad dentro de la raíz de la cual se creará la carpeta "{0}" DriveSelect = Sélectionnez le disque à la racine dans lequel le dossier "{0}" sera créé.
UserFolderRequest = ¿Le gustaría cambiar la ubicación de la carpeta "{0}"? UserFolderRequest = Voulez vous changer est placé le dossier "{0}" ?
UserFolderSelect = Seleccione una carpeta para la carpeta "{0}" UserFolderSelect = Sélectionnez un dossier pour le dossier "{0}"
UserDefaultFolder = ¿Le gustaría cambiar la ubicación de la carpeta "{0}" al valor predeterminado? UserDefaultFolder = Voulez vous changer est placé le dossier "{0}" à sa valeur par défaut?
ReservedStorageIsInUse = Cette opération n'est pas suppportée le stockage réservé est en cours d'utilisation \nVeuillez attendre la fin des opérations de maintenance, puis réessayer plus tard ReservedStorageIsInUse = Cette opération n'est pas suppportée le stockage réservé est en cours d'utilisation \nVeuillez attendre la fin des opérations de maintenance, puis réessayer plus tard
ShortcutPinning = Le raccourci "{0}" est épinglé sur Démarrer ShortcutPinning = Le raccourci "{0}" est épinglé sur Démarrer
UninstallUWPForAll = Pour tous les utilisateurs UninstallUWPForAll = Pour tous les utilisateurs
@ -26,7 +27,7 @@ WSLUpdateInstalling = Installation du package de mise à j
HEVCDownloading = Téléchargement de Extensions vidéo HEVC du fabricant de l'appareil... ~2,8 MB HEVCDownloading = Téléchargement de Extensions vidéo HEVC du fabricant de l'appareil... ~2,8 MB
GraphicsPerformanceTitle = Préférence de performances graphiques GraphicsPerformanceTitle = Préférence de performances graphiques
GraphicsPerformanceRequest = Souhaitez-vous définir le paramètre de performances graphiques d'une application de votre choix sur "Haute performance"? GraphicsPerformanceRequest = Souhaitez-vous définir le paramètre de performances graphiques d'une application de votre choix sur "Haute performance"?
TaskNotificationTitle = Notificación TaskNotificationTitle = Notificacion
CleanupTaskNotificationTitle = Une information important CleanupTaskNotificationTitle = Une information important
CleanupTaskDescription = Nettoyage des fichiers Windows inutilisés et des mises à jour à l'aide de l'application intégrée pour le nettoyage de disque CleanupTaskDescription = Nettoyage des fichiers Windows inutilisés et des mises à jour à l'aide de l'application intégrée pour le nettoyage de disque
CleanupTaskNotificationEventTitle = Exécuter la tâche pour nettoyer les fichiers et les mises à jour inutilisés de Windows? CleanupTaskNotificationEventTitle = Exécuter la tâche pour nettoyer les fichiers et les mises à jour inutilisés de Windows?
@ -77,6 +78,6 @@ Select = Sélectionner
SelectAll = Tout sélectionner SelectAll = Tout sélectionner
Skip = Passer Skip = Passer
Skipped = Passé Skipped = Passé
TelegramTitle = Rejoignez notre chaîne Telegram officielle TelegramTitle = Rejoignez notre canal Telegram officiel
Uninstall = Désinstaller Uninstall = Désinstaller
'@ '@

3
Sophia/PowerShell 7/Localizations/hu-HU/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = A szkript csak a Windows 10 64 bites verziót támogatja 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 UnsupportedOSBuild = A szkript a Windows 10 2004/20H2/21H1 és újabb kiadásokat támogatja
UnsupportedISE = A szkript nem támogatja a "Windows PowerShell ISE" futtatását
UnsupportedRelease = Új verzió érhető el 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? 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 ControlledFolderAccessDisabled = Vezérelt mappához való hozzáférés kikapcsolva

3
Sophia/PowerShell 7/Localizations/it-IT/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Lo script supporta solo Windows 10 x64 UnsupportedOSBitness = Lo script supporta solo Windows 10 x64
UnsupportedOSBuild = Lo script supporta Windows 10, 2004/20H2/21H1 versioni e superiori UnsupportedOSBuild = Lo script supporta Windows 10, 2004/20H2/21H1 versioni e superiori
UnsupportedISE = Lo script non supporta l'esecuzione tramite Windows PowerShell ISE
UnsupportedRelease = Nuova versione trovata UnsupportedRelease = Nuova versione trovata
CustomizationWarning = \nSono state personalizzate tutte le funzioni nel file delle preimpostazioni Sophia.ps1 prima di eseguire Sophia Script? 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 ControlledFolderAccessDisabled = l'accesso alle cartelle controllata disattivata

3
Sophia/PowerShell 7/Localizations/pt-BR/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = O script suporta somente Windows 10 x64 UnsupportedOSBitness = O script suporta somente Windows 10 x64
UnsupportedOSBuild = O script suporta versões Windows 10 2004/20H2/21H1 e superior UnsupportedOSBuild = O script suporta versões Windows 10 2004/20H2/21H1 e superior
UnsupportedISE = O guião não suporta a execução através do Windows PowerShell ISE
UnsupportedRelease = Nova versão encontrada 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? 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 ControlledFolderAccessDisabled = Acesso controlado a pasta desativada

3
Sophia/PowerShell 7/Localizations/ru-RU/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Скрипт поддерживает только Windows 10 x64 UnsupportedOSBitness = Скрипт поддерживает только Windows 10 x64
UnsupportedOSBuild = Скрипт поддерживает только Windows 10 версии 2004/20H2/21H1 и выше UnsupportedOSBuild = Скрипт поддерживает только Windows 10 версии 2004/20H2/21H1 и выше
UnsupportedISE = Скрипт не поддерживает работу через Windows PowerShell ISE
UnsupportedRelease = Обнаружена новая версия UnsupportedRelease = Обнаружена новая версия
CustomizationWarning = \nВы настроили все функции в пресет-файле Sophia.ps1 перед запуском Sophia Script? CustomizationWarning = \nВы настроили все функции в пресет-файле Sophia.ps1 перед запуском Sophia Script?
ControlledFolderAccessDisabled = Контролируемый доступ к папкам выключен ControlledFolderAccessDisabled = Контролируемый доступ к папкам выключен

3
Sophia/PowerShell 7/Localizations/tr-TR/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Bu betik sadece Windows 10 x64 destekliyor UnsupportedOSBitness = Bu betik sadece Windows 10 x64 destekliyor
UnsupportedOSBuild = Bu betik sadece Windows 10 2004/20H2/21H1 sürüm ve üstünü destekliyor UnsupportedOSBuild = Bu betik sadece Windows 10 2004/20H2/21H1 sürüm ve üstünü destekliyor
UnsupportedISE = Komut dosyası, Windows PowerShell ISE üzerinden çalıştırmayı desteklemiyor
UnsupportedRelease = Yeni sürüm bulundu 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? 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ı ControlledFolderAccessDisabled = Kontrollü klasör erişimi devre dışı bırakıldı

3
Sophia/PowerShell 7/Localizations/uk-UA/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Скрипт підтримує тільки Windows 10 x64 UnsupportedOSBitness = Скрипт підтримує тільки Windows 10 x64
UnsupportedOSBuild = Скрипт підтримує тільки Windows 10 версії 2004/20H2/21H1 та вище UnsupportedOSBuild = Скрипт підтримує тільки Windows 10 версії 2004/20H2/21H1 та вище
UnsupportedISE = Скрипт не підтримує роботу через Windows PowerShell ISE
UnsupportedRelease = Виявлено нову версію UnsupportedRelease = Виявлено нову версію
CustomizationWarning = \nВи налаштували всі функції в пресет-файлі Sophia.ps1 перед запуском Sophia Script? CustomizationWarning = \nВи налаштували всі функції в пресет-файлі Sophia.ps1 перед запуском Sophia Script?
ControlledFolderAccessDisabled = Контрольований доступ до папок вимкнений ControlledFolderAccessDisabled = Контрольований доступ до папок вимкнений

86
Sophia/PowerShell 7/Sophia.ps1

@ -2,11 +2,11 @@
.SYNOPSIS .SYNOPSIS
Default preset file for "Windows 10 Sophia Script" Default preset file for "Windows 10 Sophia Script"
Version: v5.10.5 Version: v5.10.6
Date: 17.05.2021 Date: 01.06.2021
Copyright (c) 20142021 farag Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & oZ-Zo Copyright (c) 20192021 farag & Inestic
Thanks to all https://forum.ru-board.com members involved Thanks to all https://forum.ru-board.com members involved
@ -40,22 +40,22 @@
. .\Function.ps1 (with a dot at the beginning) . .\Function.ps1 (with a dot at the beginning)
Read more in the Functions.ps1 file Read more in the Functions.ps1 file
.LINK GitHub link
https://github.com/farag2/Windows-10-Sophia-Script
.LINK Telegram channel & group
https://t.me/sophianews
https://t.me/sophia_chat
.NOTES .NOTES
https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15 https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15
https://habr.com/post/521202/ https://habr.com/post/521202/
https://forums.mydigitallife.net/threads/powershell-windows-10-sophia-script.81675/ https://forums.mydigitallife.net/threads/powershell-windows-10-sophia-script.81675/
https://www.reddit.com/r/PowerShell/comments/go2n5v/powershell_script_setup_windows_10/ https://www.reddit.com/r/PowerShell/comments/go2n5v/powershell_script_setup_windows_10/
.LINK Telegram channel & group .LINK Authors
https://t.me/sophianews
https://t.me/sophia_chat
.LINK
https://github.com/farag2 https://github.com/farag2
https://github.com/Inestic https://github.com/Inestic
.LINK
https://github.com/farag2/Windows-10-Sophia-Script
#> #>
#Requires -RunAsAdministrator #Requires -RunAsAdministrator
@ -71,7 +71,7 @@ param
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script v5.10.5 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & oz-zo, 2014–2021" $Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script v5.10.6 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & oz-zo, 2014–2021"
Remove-Module -Name Sophia -Force -ErrorAction Ignore Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Sophia.psd1 -PassThru -Force Import-Module -Name $PSScriptRoot\Sophia.psd1 -PassThru -Force
@ -261,7 +261,7 @@ BingSearch -Disable
#region UI & Personalization #region UI & Personalization
# Show the "This PC" icon on Desktop # Show the "This PC" icon on Desktop
# Отобразить значок "Этот компьютер" на рабочем столе # Отображать значок "Этот компьютер" на рабочем столе
ThisPC -Show ThisPC -Show
# Hide the "This PC" icon on Desktop (default value) # Hide the "This PC" icon on Desktop (default value)
@ -324,30 +324,6 @@ OneDriveFileExplorerAd -Hide
# Показывать уведомления поставщика синхронизации в проводнике (значение по умолчанию) # Показывать уведомления поставщика синхронизации в проводнике (значение по умолчанию)
# OneDriveFileExplorerAd -Show # OneDriveFileExplorerAd -Show
# Hide Task View button on the taskbar
# Скрывать кнопку Просмотра задач
TaskViewButton -Hide
# Show Task View button on the taskbar (default value)
# Показывать кнопку Просмотра задач (значение по умолчанию)
# TaskViewButton -Show
# Hide People button on the taskbar
# Скрывать панель "Люди" на панели задач
PeopleTaskbar -Hide
# Show People button on the taskbar (default value)
# Показывать панель "Люди" на панели задач (значение по умолчанию)
# PeopleTaskbar -Show
# Show seconds on the taskbar clock
# Отображать секунды в системных часах на панели задач
SecondsInSystemClock -Show
# Hide seconds on the taskbar clock (default value)
# Скрывать секунды в системных часах на панели задач (значение по умолчанию)
# SecondsInSystemClock -Hide
# When I snap a window, do not show what I can snap next to it # When I snap a window, do not show what I can snap next to it
# При прикреплении окна не показывать, что можно прикрепить рядом с ним # При прикреплении окна не показывать, что можно прикрепить рядом с ним
SnapAssist -Disable SnapAssist -Disable
@ -385,7 +361,7 @@ RecycleBinDeleteConfirmation -Enable
3DObjects -Hide 3DObjects -Hide
# Show the "3D Objects" folder in "This PC" and Quick access (default value) # Show the "3D Objects" folder in "This PC" and Quick access (default value)
# Отобразить папку "Объемные объекты" в "Этот компьютер" и панели быстрого доступа (значение по умолчанию) # Отображать папку "Объемные объекты" в "Этот компьютер" и панели быстрого доступа (значение по умолчанию)
# 3DObjects -Show # 3DObjects -Show
# Hide frequently used folders in Quick access # Hide frequently used folders in Quick access
@ -404,6 +380,30 @@ QuickAccessRecentFiles -Hide
# Показать недавно использовавшиеся файлы на панели быстрого доступа (значение по умолчанию) # Показать недавно использовавшиеся файлы на панели быстрого доступа (значение по умолчанию)
# QuickAccessRecentFiles -Show # QuickAccessRecentFiles -Show
# Hide Task View button on the taskbar
# Скрывать кнопку Просмотра задач
TaskViewButton -Hide
# Show Task View button on the taskbar (default value)
# Показывать кнопку Просмотра задач (значение по умолчанию)
# TaskViewButton -Show
# Hide People button on the taskbar
# Скрывать панель "Люди" на панели задач
PeopleTaskbar -Hide
# Show People button on the taskbar (default value)
# Показывать панель "Люди" на панели задач (значение по умолчанию)
# PeopleTaskbar -Show
# Show seconds on the taskbar clock
# Отображать секунды в системных часах на панели задач
SecondsInSystemClock -Show
# Hide seconds on the taskbar clock (default value)
# Скрывать секунды в системных часах на панели задач (значение по умолчанию)
# SecondsInSystemClock -Hide
# Hide the search on the taskbar # Hide the search on the taskbar
# Скрыть поле или значок поиска на панели задач # Скрыть поле или значок поиска на панели задач
TaskbarSearch -Hide TaskbarSearch -Hide
@ -437,9 +437,17 @@ TrayIcons -Show
MeetNow -Hide MeetNow -Hide
# Show the Meet Now icon in the notification area # Show the Meet Now icon in the notification area
# Отобразить иконку "Провести собрание" в трее # Отображать иконку "Провести собрание" в трее
# MeetNow -Show # MeetNow -Show
# Hide "News and Interests" on the taskbar
# Скрыть "Новости и интересы" на панели задач
NewsInterests -Hide
# Show "News and Interests" on the taskbar (default value)
# Отображать "Новости и интересы" на панели задач (значение по умолчанию)
# NewsInterests -Show
# Unpin Microsoft Edge and Microsoft Store from the taskbar # Unpin Microsoft Edge and Microsoft Store from the taskbar
# Открепить Microsoft Edge и Microsoft Store от панели задач # Открепить Microsoft Edge и Microsoft Store от панели задач
UnpinTaskbarEdgeStore UnpinTaskbarEdgeStore

4
Sophia/PowerShell 7/Sophia.psd1

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

529
Sophia/PowerShell 7/Sophia.psm1

@ -2,11 +2,11 @@
.SYNOPSIS .SYNOPSIS
"Windows 10 Sophia Script" is a PowerShell module for Windows 10 fine-tuning and automating the routine tasks "Windows 10 Sophia Script" is a PowerShell module for Windows 10 fine-tuning and automating the routine tasks
Version: v5.10.5 Version: v5.10.6
Date: 17.05.2021 Date: 01.06.2021
Copyright (c) 20142021 farag Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & oZ-Zo Copyright (c) 20192021 farag & Inestic
Thanks to all https://forum.ru-board.com members involved Thanks to all https://forum.ru-board.com members involved
@ -24,22 +24,22 @@
Set execution policy to be able to run scripts only in the current PowerShell session: Set execution policy to be able to run scripts only in the current PowerShell session:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force
.NOTES .LINK GitHub link
https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15 https://github.com/farag2/Windows-10-Sophia-Script
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 Telegram channel & group .LINK Telegram channel & group
https://t.me/sophianews https://t.me/sophianews
https://t.me/sophia_chat https://t.me/sophia_chat
.LINK .LINK Authors
https://github.com/farag2 https://github.com/farag2
https://github.com/Inestic https://github.com/Inestic
.LINK .NOTES
https://github.com/farag2/Windows-10-Sophia-Script 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/
#> #>
#region Checkings #region Checkings
@ -77,6 +77,13 @@ function Checkings
} }
} }
# Check whether the script has been 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 # Checking if the current module version is the latest one
try try
{ {
@ -931,6 +938,10 @@ function AdvertisingID
} }
"Enable" "Enable"
{ {
if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo))
{
New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Force
}
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -PropertyType DWord -Value 1 -Force New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -PropertyType DWord -Value 1 -Force
} }
} }
@ -1353,6 +1364,8 @@ function BingSearch
} }
} }
"Disable" "Disable"
{
if ((Get-WinHomeLocation).GeoId -eq 244)
{ {
if (-not (Test-Path -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer)) if (-not (Test-Path -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer))
{ {
@ -1362,6 +1375,7 @@ function BingSearch
} }
} }
} }
}
#endregion Privacy & Telemetry #endregion Privacy & Telemetry
#region UI & Personalization #region UI & Personalization
@ -1777,167 +1791,6 @@ function OneDriveFileExplorerAd
} }
} }
<#
.SYNOPSIS
Configure Task View button on the taskbar
.PARAMETER Hide
Show Task View button on the taskbar
.PARAMETER Show
Do not show Task View button on the taskbar
.EXAMPLE
TaskViewButton -Hide
.EXAMPLE
TaskViewButton -Show
.NOTES
Current user
#>
function TaskViewButton
{
param
(
[Parameter(
Mandatory = $true,
ParameterSetName = "Hide"
)]
[switch]
$Hide,
[Parameter(
Mandatory = $true,
ParameterSetName = "Show"
)]
[switch]
$Show
)
switch ($PSCmdlet.ParameterSetName)
{
"Hide"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -PropertyType DWord -Value 0 -Force
}
"Show"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -PropertyType DWord -Value 1 -Force
}
}
}
<#
.SYNOPSIS
Configure People button on the taskbar
.PARAMETER Hide
Hide People button on the taskbar
.PARAMETER Show
Show People button on the taskbar
.EXAMPLE
PeopleTaskbar -Hide
.EXAMPLE
PeopleTaskbar -Show
.NOTES
Current user
#>
function PeopleTaskbar
{
param
(
[Parameter(
Mandatory = $true,
ParameterSetName = "Hide"
)]
[switch]
$Hide,
[Parameter(
Mandatory = $true,
ParameterSetName = "Show"
)]
[switch]
$Show
)
switch ($PSCmdlet.ParameterSetName)
{
"Hide"
{
if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People))
{
New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Force
}
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Name PeopleBand -PropertyType DWord -Value 0 -Force
}
"Show"
{
if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People))
{
New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Force
}
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Name PeopleBand -PropertyType DWord -Value 1 -Force
}
}
}
<#
.SYNOPSIS
Configure seconds on the taskbar clock
.PARAMETER Hide
Hide seconds on the taskbar clock
.PARAMETER Show
Show seconds on the taskbar clock
.EXAMPLE
SecondsInSystemClock -Hide
.EXAMPLE
SecondsInSystemClock -Show
.NOTES
Current user
#>
function SecondsInSystemClock
{
param
(
[Parameter(
Mandatory = $true,
ParameterSetName = "Hide"
)]
[switch]
$Hide,
[Parameter(
Mandatory = $true,
ParameterSetName = "Show"
)]
[switch]
$Show
)
switch ($PSCmdlet.ParameterSetName)
{
"Hide"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSecondsInSystemClock -PropertyType DWord -Value 0 -Force
}
"Show"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSecondsInSystemClock -PropertyType DWord -Value 1 -Force
}
}
}
<# <#
.SYNOPSIS .SYNOPSIS
Configure windows snapping Configure windows snapping
@ -2145,30 +1998,6 @@ function RecycleBinDeleteConfirmation
$Enable $Enable
) )
$UpdateDesktop = @{
Namespace = "WinAPI"
Name = "UpdateDesktop"
Language = "CSharp"
MemberDefinition = @"
private static readonly IntPtr hWnd = new IntPtr(65535);
private const int Msg = 273;
// Virtual key ID of the F5 in File Explorer
private static readonly UIntPtr UIntPtr = new UIntPtr(41504);
[DllImport("user32.dll", SetLastError=true)]
public static extern int PostMessageW(IntPtr hWnd, uint Msg, UIntPtr wParam, IntPtr lParam);
public static void PostMessage()
{
// F5 pressing simulation to refresh the desktop
PostMessageW(hWnd, Msg, UIntPtr, IntPtr.Zero);
}
"@
}
if (-not ("WinAPI.UpdateDesktop" -as [type]))
{
Add-Type @UpdateDesktop
}
$ShellState = Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState $ShellState = Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState
switch ($PSCmdlet.ParameterSetName) switch ($PSCmdlet.ParameterSetName)
@ -2184,9 +2013,6 @@ public static void PostMessage()
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState -PropertyType Binary -Value $ShellState -Force New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState -PropertyType Binary -Value $ShellState -Force
} }
} }
# Send F5 pressing simulation to refresh the desktop
[WinAPI.UpdateDesktop]::PostMessage()
} }
<# <#
@ -2364,6 +2190,167 @@ function QuickAccessRecentFiles
} }
} }
<#
.SYNOPSIS
Configure Task View button on the taskbar
.PARAMETER Hide
Show Task View button on the taskbar
.PARAMETER Show
Do not show Task View button on the taskbar
.EXAMPLE
TaskViewButton -Hide
.EXAMPLE
TaskViewButton -Show
.NOTES
Current user
#>
function TaskViewButton
{
param
(
[Parameter(
Mandatory = $true,
ParameterSetName = "Hide"
)]
[switch]
$Hide,
[Parameter(
Mandatory = $true,
ParameterSetName = "Show"
)]
[switch]
$Show
)
switch ($PSCmdlet.ParameterSetName)
{
"Hide"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -PropertyType DWord -Value 0 -Force
}
"Show"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -PropertyType DWord -Value 1 -Force
}
}
}
<#
.SYNOPSIS
Configure People button on the taskbar
.PARAMETER Hide
Hide People button on the taskbar
.PARAMETER Show
Show People button on the taskbar
.EXAMPLE
PeopleTaskbar -Hide
.EXAMPLE
PeopleTaskbar -Show
.NOTES
Current user
#>
function PeopleTaskbar
{
param
(
[Parameter(
Mandatory = $true,
ParameterSetName = "Hide"
)]
[switch]
$Hide,
[Parameter(
Mandatory = $true,
ParameterSetName = "Show"
)]
[switch]
$Show
)
switch ($PSCmdlet.ParameterSetName)
{
"Hide"
{
if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People))
{
New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Force
}
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Name PeopleBand -PropertyType DWord -Value 0 -Force
}
"Show"
{
if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People))
{
New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Force
}
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Name PeopleBand -PropertyType DWord -Value 1 -Force
}
}
}
<#
.SYNOPSIS
Configure seconds on the taskbar clock
.PARAMETER Hide
Hide seconds on the taskbar clock
.PARAMETER Show
Show seconds on the taskbar clock
.EXAMPLE
SecondsInSystemClock -Hide
.EXAMPLE
SecondsInSystemClock -Show
.NOTES
Current user
#>
function SecondsInSystemClock
{
param
(
[Parameter(
Mandatory = $true,
ParameterSetName = "Hide"
)]
[switch]
$Hide,
[Parameter(
Mandatory = $true,
ParameterSetName = "Show"
)]
[switch]
$Show
)
switch ($PSCmdlet.ParameterSetName)
{
"Hide"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSecondsInSystemClock -PropertyType DWord -Value 0 -Force
}
"Show"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSecondsInSystemClock -PropertyType DWord -Value 1 -Force
}
}
}
<# <#
.SYNOPSIS .SYNOPSIS
Configure search on the taskbar Configure search on the taskbar
@ -2607,17 +2594,70 @@ function MeetNow
} }
} }
<#
.SYNOPSIS
Configure "News and Interests"
.PARAMETER Show
Show "News and Interests"
.PARAMETER Hide
Hide "News and Interests"
.EXAMPLE
NewsInterests -Show
.EXAMPLE
NewsInterests -Hide
.NOTES
Current user
#>
function NewsInterests
{
param
(
[Parameter(
Mandatory = $true,
ParameterSetName = "Show"
)]
[switch]
$Show,
[Parameter(
Mandatory = $true,
ParameterSetName = "Hide"
)]
[switch]
$Hide
)
switch ($PSCmdlet.ParameterSetName)
{
"Show"
{
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name ShellFeedsTaskbarViewMode -PropertyType DWord -Value 0 -Force
}
"Hide"
{
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name ShellFeedsTaskbarViewMode -PropertyType DWord -Value 2 -Force
}
}
}
<# <#
.SYNOPSIS .SYNOPSIS
Unpin "Microsoft Edge" and "Microsoft Store" from the taskbar Unpin "Microsoft Edge" and "Microsoft Store" from the taskbar
.NOTES .NOTES
Current user Current user
.LINK
https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/8#issue-227159084
#> #>
function UnpinTaskbarEdgeStore function UnpinTaskbarEdgeStore
{ {
# Extract strings from shell32.dll using its' number # Extract strings from shell32.dll using its' number
# https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/8#issue-227159084
$Signature = @{ $Signature = @{
Namespace = "WinAPI" Namespace = "WinAPI"
Name = "GetStr" Name = "GetStr"
@ -7121,6 +7161,10 @@ function Set-Association
# Generate ProgId # Generate ProgId
$ProgId = (Get-Item -Path $ProgramPath).BaseName + $Extension.ToUpper() $ProgId = (Get-Item -Path $ProgramPath).BaseName + $Extension.ToUpper()
} }
else
{
$ProgId = $ProgramPath
}
#region functions #region functions
$RegistryUtils = @' $RegistryUtils = @'
@ -7285,7 +7329,8 @@ namespace RegistryUtils
) )
$OpenSubKey = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($SubKey,'ReadWriteSubTree','TakeOwnership') $OpenSubKey = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($SubKey,'ReadWriteSubTree','TakeOwnership')
if ($OpenSubKey)
{
$Acl = [System.Security.AccessControl.RegistrySecurity]::new() $Acl = [System.Security.AccessControl.RegistrySecurity]::new()
# Get current user SID # Get current user SID
$UserSID = (Get-CimInstance -ClassName Win32_UserAccount | Where-Object -FilterScript {$_.Name -eq $env:USERNAME}).SID $UserSID = (Get-CimInstance -ClassName Win32_UserAccount | Where-Object -FilterScript {$_.Name -eq $env:USERNAME}).SID
@ -7293,6 +7338,7 @@ namespace RegistryUtils
$OpenSubKey.SetAccessControl($Acl) $OpenSubKey.SetAccessControl($Acl)
$OpenSubKey.Close() $OpenSubKey.Close()
} }
}
function Write-ExtensionKeys function Write-ExtensionKeys
{ {
@ -7314,22 +7360,21 @@ namespace RegistryUtils
) )
$OrigProgID = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Classes\$Extension" -Name "(default)" -ErrorAction Ignore)."(default)" $OrigProgID = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Classes\$Extension" -Name "(default)" -ErrorAction Ignore)."(default)"
if ($OrigProgID) if ($OrigProgID)
{ {
# Save possible ProgIds history with extension # Save possible ProgIds history with extension
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" -Name "$ProgID`_$Extension" -PropertyType String -Value 0 -Force New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" -Name "$ProgID`_$Extension" -PropertyType DWord -Value 0 -Force
} }
$Name = (Get-Item -Path $ProgramPath).Name + $Extension $Name = "{0}_$Extension" -f (Split-Path -Path $ProgId -Leaf)
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" -Name $Name -PropertyType String -Value 0 -Force New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" -Name $Name -PropertyType DWord -Value 0 -Force
if ("$ProgId`_$Extension" -ne $Name) if ("$ProgId`_$Extension" -ne $Name)
{ {
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" -Name "$ProgId`_$Extension" -PropertyType String -Value 0 -Force New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" -Name "$ProgId`_$Extension" -PropertyType DWord -Value 0 -Force
} }
# If ProgId doesn't exist set the specified ProgId for the extansions # If ProgId doesn't exist set the specified ProgId for the extensions
if (-not $OrigProgID) if (-not $OrigProgID)
{ {
if (-not (Test-Path -Path "HKCU:\SOFTWARE\Classes\$Extension")) if (-not (Test-Path -Path "HKCU:\SOFTWARE\Classes\$Extension"))
@ -7430,7 +7475,7 @@ namespace RegistryUtils
} }
$picture = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\KindMap" -Name $Extension -ErrorAction Ignore).$Extension $picture = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\KindMap" -Name $Extension -ErrorAction Ignore).$Extension
$PBrush = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Classes\PBrush\CLSID" -Name "(default)" $PBrush = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Classes\PBrush\CLSID" -Name "(default)" -ErrorAction Ignore)."(default)"
if (($picture -eq "picture") -and $PBrush) if (($picture -eq "picture") -and $PBrush)
{ {
@ -7651,7 +7696,7 @@ namespace FileAssoc
} }
New-ItemProperty -Path "HKCU:\SOFTWARE\Classes\$ProgId\shell\open\command" -Name "(Default)" -PropertyType String -Value "`"$ProgramPath`" `"%1`"" -Force New-ItemProperty -Path "HKCU:\SOFTWARE\Classes\$ProgId\shell\open\command" -Name "(Default)" -PropertyType String -Value "`"$ProgramPath`" `"%1`"" -Force
$FileNameEXE = (Get-Item -Path $ProgramPath).Name $FileNameEXE = Split-Path -Path $ProgramPath -Leaf
if (-not (Test-Path -Path "HKCU:\SOFTWARE\Classes\Applications\$FileNameEXE\shell\open\command")) if (-not (Test-Path -Path "HKCU:\SOFTWARE\Classes\Applications\$FileNameEXE\shell\open\command"))
{ {
New-Item -Path "HKCU:\SOFTWARE\Classes\Applications\$FileNameEXE\shell\open\command" -Force New-Item -Path "HKCU:\SOFTWARE\Classes\Applications\$FileNameEXE\shell\open\command" -Force
@ -7671,6 +7716,29 @@ namespace FileAssoc
# If the file extension specified configure the extension # If the file extension specified configure the extension
Write-ExtensionKeys -ProgId $ProgId -Extension $Extension Write-ExtensionKeys -ProgId $ProgId -Extension $Extension
# Refresh the desktop icons
$UpdateExplorer = @{
Namespace = "WinAPI"
Name = "UpdateExplorer"
Language = "CSharp"
MemberDefinition = @"
[DllImport("shell32.dll", CharSet = CharSet.Auto, SetLastError = false)]
private static extern int SHChangeNotify(int eventId, int flags, IntPtr item1, IntPtr item2);
public static void Refresh()
{
// Update desktop icons
SHChangeNotify(0x8000000, 0x1000, IntPtr.Zero, IntPtr.Zero);
}
"@
}
if (-not ("WinAPI.UpdateExplorer" -as [type]))
{
Add-Type @UpdateExplorer
}
[WinAPI.UpdateExplorer]::Refresh()
} }
#endregion System #endregion System
@ -8276,8 +8344,8 @@ public static string GetString(uint strId)
.NOTES .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 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.5 CsWinRT v1.2.6
Microsoft.Windows.SDK.NET 10.0.19041.16 Microsoft.Windows.SDK.NET 10.0.19041.17
.LINK .LINK
https://github.com/microsoft/CsWinRT https://github.com/microsoft/CsWinRT
@ -8731,8 +8799,8 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
.NOTES .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 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.5 CsWinRT v1.2.6
Microsoft.Windows.SDK.NET 10.0.19041.16 Microsoft.Windows.SDK.NET 10.0.19041.17
.LINK .LINK
https://github.com/microsoft/CsWinRT https://github.com/microsoft/CsWinRT
@ -11061,6 +11129,10 @@ function MSIExtractContext
.EXAMPLE .EXAMPLE
CABInstallContext -Add 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
.NOTES .NOTES
Current user Current user
#> #>
@ -11087,10 +11159,17 @@ function CABInstallContext
{ {
"Remove" "Remove"
{ {
Remove-Item -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs\Command -Recurse -Force -ErrorAction SilentlyContinue Remove-Item -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs -Recurse -Force -ErrorAction SilentlyContinue
} }
"Add" "Add"
{ {
# Checking whether the File Explorer is associated with the .cab files
if (-not ((Get-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.cab\UserChoice -Name ProgId -ErrorAction Ignore) -notmatch "cab"))
{
# 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)) 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
@ -12086,12 +12165,12 @@ function PreviousVersionsPage
} }
#endregion Context menu #endregion Context menu
#region Refresh #region Refresh Environment
function Refresh function RefreshEnvironment
{ {
$UpdateExplorer = @{ $UpdateEnvironment = @{
Namespace = "WinAPI" Namespace = "WinAPI"
Name = "UpdateExplorer" Name = "UpdateEnvironment"
Language = "CSharp" Language = "CSharp"
MemberDefinition = @" MemberDefinition = @"
private static readonly IntPtr HWND_BROADCAST = new IntPtr(0xffff); private static readonly IntPtr HWND_BROADCAST = new IntPtr(0xffff);
@ -12134,16 +12213,16 @@ public static void PostMessage()
} }
"@ "@
} }
if (-not ("WinAPI.UpdateExplorer" -as [type])) if (-not ("WinAPI.UpdateEnvironment" -as [type]))
{ {
Add-Type @UpdateExplorer Add-Type @UpdateEnvironment
} }
# Simulate pressing F5 to refresh the desktop # Simulate pressing F5 to refresh the desktop
[WinAPI.UpdateExplorer]::PostMessage() [WinAPI.UpdateEnvironment]::PostMessage()
# Refresh desktop icons, environment variables, taskbar # Refresh desktop icons, environment variables, taskbar
[WinAPI.UpdateExplorer]::Refresh() [WinAPI.UpdateEnvironment]::Refresh()
# Restart the Start menu # Restart the Start menu
Stop-Process -Name StartMenuExperienceHost -Force -ErrorAction Ignore Stop-Process -Name StartMenuExperienceHost -Force -ErrorAction Ignore
@ -12159,8 +12238,8 @@ public static void PostMessage()
<# <#
.NOTES .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 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.5 CsWinRT v1.2.6
Microsoft.Windows.SDK.NET 10.0.19041.16 Microsoft.Windows.SDK.NET 10.0.19041.17
.LINK .LINK
https://github.com/microsoft/CsWinRT https://github.com/microsoft/CsWinRT
@ -12196,7 +12275,7 @@ public static void PostMessage()
$ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML) $ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel").Show($ToastMessage) [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel").Show($ToastMessage)
} }
#endregion Refresh #endregion Refresh Environment
# Errors output # Errors output
function Errors function Errors

Loading…
Cancel
Save