Browse Source

02.01.2021 v5.10.6

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

10
Sophia/PowerShell 5.1/Functions.ps1

@ -2,8 +2,8 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v5.10.5
Date: 14.05.2021
Version: v5.10.6
Date: 01.06.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & oZ-Zo
@ -53,7 +53,7 @@ function Sophia
$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}
foreach ($Function in $Functions)
@ -61,12 +61,12 @@ function Sophia
Invoke-Expression -Command $Function
}
Invoke-Command -ScriptBlock {Refresh; Errors}
Invoke-Command -ScriptBlock {RefreshEnvironment; Errors}
}
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
Import-Module -Name $PSScriptRoot\Sophia.psd1 -PassThru -Force

1
Sophia/PowerShell 5.1/Localizations/cn-CN/Sophia.psd1

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

1
Sophia/PowerShell 5.1/Localizations/de-DE/Sophia.psd1

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

1
Sophia/PowerShell 5.1/Localizations/en-US/Sophia.psd1

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

1
Sophia/PowerShell 5.1/Localizations/es-ES/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = El script sólo es compatible con Windows 10 x64
UnsupportedOSBuild = El script es compatible con versión Windows 10 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
CustomizationWarning = \n¿Ha personalizado todas las funciones del archivo predeterminado Sophia.ps1 antes de ejecutar Sophia Script?
ControlledFolderAccessDisabled = Acceso a la carpeta controlada deshabilitado

13
Sophia/PowerShell 5.1/Localizations/fr-FR/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Le script supporte uniquement Windows 10 x64
UnsupportedOSBuild = Le script supporte les versions Windows 10 2004/20H2/21H1 et ultérieures
UnsupportedISE = Le script ne supporte pas l'exécution via Windows PowerShell ISE
UnsupportedRelease = Nouvelle version trouvée
CustomizationWarning = \nAvez-vous personnalisé chaque fonction du fichier de préréglage Sophia.ps1 avant d'exécuter Sophia Script?
ControlledFolderAccessDisabled = Contrôle d'accès aux dossiers désactivé
@ -13,10 +14,10 @@ OptionalFeaturesTitle = Fonctionnalités optionnelles
EnableHardwareVT = Activer la virtualisation dans UEFI
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...
DriveSelect = Seleccione la unidad dentro de la raíz de la cual se creará la carpeta "{0}"
UserFolderRequest = ¿Le gustaría cambiar la ubicación de la carpeta "{0}"?
UserFolderSelect = Seleccione una carpeta para la carpeta "{0}"
UserDefaultFolder = ¿Le gustaría cambiar la ubicación de la carpeta "{0}" al valor predeterminado?
DriveSelect = Sélectionnez le disque à la racine dans lequel le dossier "{0}" sera créé.
UserFolderRequest = Voulez vous changer est placé le dossier "{0}" ?
UserFolderSelect = Sélectionnez un dossier pour le dossier "{0}"
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
ShortcutPinning = Le raccourci "{0}" est épinglé sur Démarrer
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
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"?
TaskNotificationTitle = Notificación
TaskNotificationTitle = Notificacion
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
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
Skip = Passer
Skipped = Passé
TelegramTitle = Rejoignez notre chaîne Telegram officielle
TelegramTitle = Rejoignez notre canal Telegram officiel
Uninstall = Désinstaller
'@

1
Sophia/PowerShell 5.1/Localizations/hu-HU/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = A szkript csak a Windows 10 64 bites verziót támogatja
UnsupportedOSBuild = A szkript 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
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

1
Sophia/PowerShell 5.1/Localizations/it-IT/Sophia.psd1

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

1
Sophia/PowerShell 5.1/Localizations/pt-BR/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = O script suporta somente Windows 10 x64
UnsupportedOSBuild = O script suporta versões Windows 10 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
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

1
Sophia/PowerShell 5.1/Localizations/ru-RU/Sophia.psd1

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

1
Sophia/PowerShell 5.1/Localizations/tr-TR/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Bu betik sadece Windows 10 x64 destekliyor
UnsupportedOSBuild = Bu betik sadece Windows 10 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
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ı

1
Sophia/PowerShell 5.1/Localizations/uk-UA/Sophia.psd1

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

99
Sophia/PowerShell 5.1/Sophia.ps1

@ -2,11 +2,11 @@
.SYNOPSIS
Default preset file for "Windows 10 Sophia Script"
Version: v5.10.5
Date: 14.05.2021
Version: v5.10.6
Date: 01.06.2021
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
@ -40,22 +40,22 @@
. .\Function.ps1 (with a dot at the beginning)
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
https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15
https://habr.com/post/521202/
https://forums.mydigitallife.net/threads/powershell-windows-10-sophia-script.81675/
https://www.reddit.com/r/PowerShell/comments/go2n5v/powershell_script_setup_windows_10/
.LINK Telegram channel & group
https://t.me/sophianews
https://t.me/sophia_chat
.LINK
.LINK Authors
https://github.com/farag2
https://github.com/Inestic
.LINK
https://github.com/farag2/Windows-10-Sophia-Script
#>
#Requires -RunAsAdministrator
@ -71,7 +71,7 @@ param
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
Import-Module -Name $PSScriptRoot\Sophia.psd1 -PassThru -Force
@ -261,7 +261,7 @@ BingSearch -Disable
#region UI & Personalization
# Show the "This PC" icon on Desktop
# Отобразить значок "Этот компьютер" на рабочем столе
# Отображать значок "Этот компьютер" на рабочем столе
ThisPC -Show
# Hide the "This PC" icon on Desktop (default value)
@ -324,30 +324,6 @@ OneDriveFileExplorerAd -Hide
# Показывать уведомления поставщика синхронизации в проводнике (значение по умолчанию)
# 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
# При прикреплении окна не показывать, что можно прикрепить рядом с ним
SnapAssist -Disable
@ -385,7 +361,7 @@ RecycleBinDeleteConfirmation -Enable
3DObjects -Hide
# Show the "3D Objects" folder in "This PC" and Quick access (default value)
# Отобразить папку "Объемные объекты" в "Этот компьютер" и панели быстрого доступа (значение по умолчанию)
# Отображать папку "Объемные объекты" в "Этот компьютер" и панели быстрого доступа (значение по умолчанию)
# 3DObjects -Show
# Hide frequently used folders in Quick access
@ -404,6 +380,30 @@ QuickAccessRecentFiles -Hide
# Показать недавно использовавшиеся файлы на панели быстрого доступа (значение по умолчанию)
# 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
# Скрыть поле или значок поиска на панели задач
TaskbarSearch -Hide
@ -437,9 +437,17 @@ TrayIcons -Show
MeetNow -Hide
# Show the Meet Now icon in the notification area
# Отобразить иконку "Провести собрание" в трее
# Отображать иконку "Провести собрание" в трее
# 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
# Открепить Microsoft Edge и Microsoft Store от панели задач
UnpinTaskbarEdgeStore
@ -1269,8 +1277,15 @@ MSIExtractContext -Add
# Удалить пункт "Извлечь все" из контекстного меню Windows Installer (.msi) (значение по умолчанию)
# MSIExtractContext -Remove
# Add the "Install" item to the .cab archives context menu
# Добавить пункт "Установить" в контекстное меню .cab архивов
<#
Add the "Install" item to the .cab archives context menu
If the .cab file extension type associated to open with a third party app by default, the "Install" context menu item won't be displayed,
so the default association for the .cab file type will be restored forcedly
Добавить пункт "Установить" в контекстное меню .cab архивов
Если .cab файлы ассоциированы со сторонним приложением, пункт "Установить" в контекстное меню не будет отображаться,
поэтому принудительно будет восстановлена ассоциация по умолчанию
#>
CABInstallContext -Add
# Remove the "Install" item from the .cab archives context menu (default value)
@ -1425,7 +1440,7 @@ PreviousVersionsPage -Hide
Перезапустить меню "Пуск"
Пожалуйста, не комментируйте данную функцию
#>
Refresh
RefreshEnvironment
<#
Errors output

4
Sophia/PowerShell 5.1/Sophia.psd1

@ -1,9 +1,9 @@
@{
RootModule = 'Sophia.psm1'
ModuleVersion = '5.10.5'
ModuleVersion = '5.10.6'
GUID = '109cc881-c42b-45af-a74a-550781989d6a'
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'
PowerShellVersion = '5.1'
ProcessorArchitecture = 'AMD64'

535
Sophia/PowerShell 5.1/Sophia.psm1

@ -2,11 +2,11 @@
.SYNOPSIS
"Windows 10 Sophia Script" is a PowerShell module for Windows 10 fine-tuning and automating the routine tasks
Version: v5.10.5
Date: 14.05.2021
Version: v5.10.6
Date: 01.06.2021
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
@ -24,22 +24,22 @@
Set execution policy to be able to run scripts only in the current PowerShell session:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force
.NOTES
https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15
https://habr.com/post/521202/
https://forums.mydigitallife.net/threads/powershell-windows-10-sophia-script.81675/
https://www.reddit.com/r/PowerShell/comments/go2n5v/powershell_script_setup_windows_10/
.LINK GitHub link
https://github.com/farag2/Windows-10-Sophia-Script
.LINK Telegram channel & group
https://t.me/sophianews
https://t.me/sophia_chat
.LINK
.LINK Authors
https://github.com/farag2
https://github.com/Inestic
.LINK
https://github.com/farag2/Windows-10-Sophia-Script
.NOTES
https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15
https://habr.com/post/521202/
https://forums.mydigitallife.net/threads/powershell-windows-10-sophia-script.81675/
https://www.reddit.com/r/PowerShell/comments/go2n5v/powershell_script_setup_windows_10/
#>
#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
try
{
@ -928,6 +935,10 @@ function AdvertisingID
}
"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
}
}
@ -1351,11 +1362,14 @@ function BingSearch
}
"Disable"
{
if (-not (Test-Path -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer))
if ((Get-WinHomeLocation).GeoId -eq 244)
{
New-Item -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Force
if (-not (Test-Path -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer))
{
New-Item -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Force
}
New-ItemProperty -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableSearchBoxSuggestions -PropertyType DWord -Value 1 -Force
}
New-ItemProperty -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableSearchBoxSuggestions -PropertyType DWord -Value 1 -Force
}
}
}
@ -1774,167 +1788,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
Configure windows snapping
@ -2142,30 +1995,6 @@ function RecycleBinDeleteConfirmation
$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
switch ($PSCmdlet.ParameterSetName)
@ -2181,9 +2010,6 @@ public static void PostMessage()
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()
}
<#
@ -2361,6 +2187,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
Configure search on the taskbar
@ -2604,17 +2591,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
Unpin "Microsoft Edge" and "Microsoft Store" from the taskbar
.NOTES
Current user
.LINK
https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/8#issue-227159084
#>
function UnpinTaskbarEdgeStore
{
# Extract strings from shell32.dll using its' number
# https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/8#issue-227159084
$Signature = @{
Namespace = "WinAPI"
Name = "GetStr"
@ -7107,6 +7147,10 @@ function Set-Association
# Generate ProgId
$ProgId = (Get-Item -Path $ProgramPath).BaseName + $Extension.ToUpper()
}
else
{
$ProgId = $ProgramPath
}
#region functions
$RegistryUtils = @'
@ -7271,13 +7315,15 @@ namespace RegistryUtils
)
$OpenSubKey = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($SubKey,'ReadWriteSubTree','TakeOwnership')
$Acl = [System.Security.AccessControl.RegistrySecurity]::new()
# Get current user SID
$UserSID = (Get-CimInstance -ClassName Win32_UserAccount | Where-Object -FilterScript {$_.Name -eq $env:USERNAME}).SID
$Acl.SetSecurityDescriptorSddlForm("O:$UserSID`G:$UserSID`D:AI(D;;DC;;;$UserSID)")
$OpenSubKey.SetAccessControl($Acl)
$OpenSubKey.Close()
if ($OpenSubKey)
{
$Acl = [System.Security.AccessControl.RegistrySecurity]::new()
# Get current user SID
$UserSID = (Get-CimInstance -ClassName Win32_UserAccount | Where-Object -FilterScript {$_.Name -eq $env:USERNAME}).SID
$Acl.SetSecurityDescriptorSddlForm("O:$UserSID`G:$UserSID`D:AI(D;;DC;;;$UserSID)")
$OpenSubKey.SetAccessControl($Acl)
$OpenSubKey.Close()
}
}
function Write-ExtensionKeys
@ -7300,22 +7346,21 @@ namespace RegistryUtils
)
$OrigProgID = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Classes\$Extension" -Name "(default)" -ErrorAction Ignore)."(default)"
if ($OrigProgID)
{
# 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
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" -Name $Name -PropertyType String -Value 0 -Force
$Name = "{0}_$Extension" -f (Split-Path -Path $ProgId -Leaf)
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" -Name $Name -PropertyType DWord -Value 0 -Force
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 (Test-Path -Path "HKCU:\SOFTWARE\Classes\$Extension"))
@ -7416,7 +7461,7 @@ namespace RegistryUtils
}
$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)
{
@ -7637,7 +7682,7 @@ namespace FileAssoc
}
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"))
{
New-Item -Path "HKCU:\SOFTWARE\Classes\Applications\$FileNameEXE\shell\open\command" -Force
@ -7657,6 +7702,29 @@ namespace FileAssoc
# If the file extension specified configure the 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
@ -11025,6 +11093,10 @@ function MSIExtractContext
.EXAMPLE
CABInstallContext -Add
.NOTES
If the .cab file extension type associated to open with a third party app by default, the "Install" context menu item won't be displayed,
so the default association for the .cab file type will be restored forcedly
.NOTES
Current user
#>
@ -11051,10 +11123,17 @@ function CABInstallContext
{
"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"
{
# 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))
{
New-Item -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs\Command -Force
@ -12050,12 +12129,12 @@ function PreviousVersionsPage
}
#endregion Context menu
#region Refresh
function Refresh
#region Refresh Environment
function RefreshEnvironment
{
$UpdateExplorer = @{
$UpdateEnvironment = @{
Namespace = "WinAPI"
Name = "UpdateExplorer"
Name = "UpdateEnvironment"
Language = "CSharp"
MemberDefinition = @"
private static readonly IntPtr HWND_BROADCAST = new IntPtr(0xffff);
@ -12098,16 +12177,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
[WinAPI.UpdateExplorer]::PostMessage()
[WinAPI.UpdateEnvironment]::PostMessage()
# Refresh desktop icons, environment variables, taskbar
[WinAPI.UpdateExplorer]::Refresh()
[WinAPI.UpdateEnvironment]::Refresh()
# Restart the Start menu
Stop-Process -Name StartMenuExperienceHost -Force -ErrorAction Ignore
@ -12149,7 +12228,7 @@ public static void PostMessage()
$ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel").Show($ToastMessage)
}
#endregion Refresh
#endregion Refresh Environment
# Errors output
function Errors

Loading…
Cancel
Save