Browse Source

v4.5.5 07.07.2020

# Windows 10 2004 | 1903/1909 Version

## Updated

- Closed #40 & #39
- Comments;
- Minor changes.

## Версия для Windows 10 2004 | 1903/1909

## Обновлено

- Закрыты #40 и #39
- Комментарии;
- Незначительные изменения.
pull/59/head 4.5.5
Dmitry Nefedov 6 years ago
committed by GitHub
parent
commit
f6be74d136
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 99
      Win 10 1903-1909.ps1
  2. 72
      Win 10 2004.ps1

99
Win 10 1903-1909.ps1

@ -2,8 +2,8 @@
.SYNOPSIS .SYNOPSIS
"Windows 10 Setup Script" is a set of tweaks for OS fine-tuning and automating the routine tasks "Windows 10 Setup Script" is a set of tweaks for OS fine-tuning and automating the routine tasks
Version: v4.4.5 Version: v4.4.6
Date: 29.06.2020 Date: 07.07.2020
Copyright (c) 2020 farag & oZ-Zo Copyright (c) 2020 farag & oZ-Zo
Thanks to all http://forum.ru-board.com members involved Thanks to all http://forum.ru-board.com members involved
@ -20,6 +20,10 @@
Running the script is best done on a fresh install because running it on tweaked system may result in errors occurring Running the script is best done on a fresh install because running it on tweaked system may result in errors occurring
Some third-party antiviruses flag this script or its' part as malicious one. This is a false positive due to $EncodedScript variable
You can read more on section "Create a Windows cleaning up task in the Task Scheduler"
You might need to disable tamper protection from your antivirus settings,re-enable it after running the script, and reboot
Check whether the .ps1 file is encoded in UTF-8 with BOM Check whether the .ps1 file is encoded in UTF-8 with BOM
The script can not be executed via PowerShell ISE The script can not be executed via PowerShell ISE
PowerShell must be run with elevated privileges PowerShell must be run with elevated privileges
@ -2444,33 +2448,6 @@ New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -Prope
# Отключить советы Xbox Game Bar # Отключить советы Xbox Game Bar
New-ItemProperty -Path HKCU:\Software\Microsoft\GameBar -Name ShowStartupPanel -PropertyType DWord -Value 0 -Force New-ItemProperty -Path HKCU:\Software\Microsoft\GameBar -Name ShowStartupPanel -PropertyType DWord -Value 0 -Force
<#
Uninstall all Xbox related UWP apps from all accounts
App packages will not be installed when new user accounts are created
Удалить все UWP-приложения, связанные с Xbox, из всех учетных записей
Приложения не будут установлены при создании новых учетных записей
#>
$XboxAppxPackages = @(
# Xbox Identity Provider
# Поставщик удостоверений Xbox
"Microsoft.XboxIdentityProvider"
# Xbox
# Компаньон консоли Xbox
"Microsoft.XboxApp"
# Xbox TCUI
"Microsoft.Xbox.TCUI"
# Xbox Speech To Text Overlay
"Microsoft.XboxSpeechToTextOverlay"
# Xbox Game Bar
"Microsoft.XboxGamingOverlay"
# Xbox Game Bar Plugin
"Microsoft.XboxGameOverlay"
)
$OFS = "|"
Get-AppxPackage -PackageTypeFilter Bundle -AllUsers | Where-Object -FilterScript {$_.Name -cmatch $XboxAppxPackages} | Remove-AppxPackage -AllUsers -Verbose
$OFS = " "
# Set "High performance" in graphics performance preference for apps # Set "High performance" in graphics performance preference for apps
# Установить параметры производительности графики для отдельных приложений на "Высокая производительность" # Установить параметры производительности графики для отдельных приложений на "Высокая производительность"
if (Get-CimInstance -ClassName Win32_VideoController | Where-Object -FilterScript {$_.AdapterDACType -ne "Internal" -and $null -ne $_.AdapterDACType}) if (Get-CimInstance -ClassName Win32_VideoController | Where-Object -FilterScript {$_.AdapterDACType -ne "Internal" -and $null -ne $_.AdapterDACType})
@ -2488,8 +2465,10 @@ if (Get-CimInstance -ClassName Win32_VideoController | Where-Object -FilterScrip
$Options = "&Add", "&Skip" $Options = "&Add", "&Skip"
} }
$DefaultChoice = 1 $DefaultChoice = 1
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
do
{
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
switch ($Result) switch ($Result)
{ {
"0" "0"
@ -2534,6 +2513,8 @@ if (Get-CimInstance -ClassName Win32_VideoController | Where-Object -FilterScrip
} }
} }
} }
until ($Result -eq 1)
}
#endregion Gaming #endregion Gaming
#region Scheduled tasks #region Scheduled tasks
@ -2802,8 +2783,10 @@ else
$Options = "&Add a protected folder", "&Skip" $Options = "&Add a protected folder", "&Skip"
} }
$DefaultChoice = 1 $DefaultChoice = 1
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
do
{
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
switch ($Result) switch ($Result)
{ {
"0" "0"
@ -2828,7 +2811,6 @@ switch ($Result)
Set-MpPreference -EnableControlledFolderAccess Enabled Set-MpPreference -EnableControlledFolderAccess Enabled
Add-MpPreference -ControlledFolderAccessProtectedFolders $FolderBrowserDialog.SelectedPath -Force Add-MpPreference -ControlledFolderAccessProtectedFolders $FolderBrowserDialog.SelectedPath -Force
} }
$Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
} }
"1" "1"
{ {
@ -2842,6 +2824,8 @@ switch ($Result)
} }
} }
} }
}
until ($Result -eq 1)
# Allow an app through Controlled folder access # Allow an app through Controlled folder access
# Разрешить работу приложения через контролируемый доступ к папкам # Разрешить работу приложения через контролируемый доступ к папкам
@ -2860,8 +2844,10 @@ if ((Get-MpPreference).EnableControlledFolderAccess -eq 1)
$Options = "&Add a protected folder", "&Skip" $Options = "&Add a protected folder", "&Skip"
} }
$DefaultChoice = 1 $DefaultChoice = 1
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
do
{
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
switch ($Result) switch ($Result)
{ {
"0" "0"
@ -2886,7 +2872,6 @@ if ((Get-MpPreference).EnableControlledFolderAccess -eq 1)
{ {
Add-MpPreference -ControlledFolderAccessAllowedApplications $OpenFileDialog.FileName -Force Add-MpPreference -ControlledFolderAccessAllowedApplications $OpenFileDialog.FileName -Force
} }
$Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
} }
"1" "1"
{ {
@ -2901,6 +2886,8 @@ if ((Get-MpPreference).EnableControlledFolderAccess -eq 1)
} }
} }
} }
until ($Result -eq 1)
}
# Add exclusion folder from Windows Defender Antivirus scanning # Add exclusion folder from Windows Defender Antivirus scanning
# Добавить папку в список исключений сканирования Windows Defender # Добавить папку в список исключений сканирования Windows Defender
@ -2917,8 +2904,10 @@ else
$Options = "&Exclude folder", "&Skip" $Options = "&Exclude folder", "&Skip"
} }
$DefaultChoice = 1 $DefaultChoice = 1
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
do
{
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
switch ($Result) switch ($Result)
{ {
"0" "0"
@ -2942,7 +2931,6 @@ switch ($Result)
{ {
Add-MpPreference -ExclusionPath $FolderBrowserDialog.SelectedPath -Force Add-MpPreference -ExclusionPath $FolderBrowserDialog.SelectedPath -Force
} }
$Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
} }
"1" "1"
{ {
@ -2956,6 +2944,8 @@ switch ($Result)
} }
} }
} }
}
until ($Result -eq 1)
# Add exclusion file from Windows Defender Antivirus scanning # Add exclusion file from Windows Defender Antivirus scanning
# Добавить файл в список исключений сканирования Windows Defender # Добавить файл в список исключений сканирования Windows Defender
@ -2972,8 +2962,10 @@ else
$Options = "&Exclude file", "&Skip" $Options = "&Exclude file", "&Skip"
} }
$DefaultChoice = 1 $DefaultChoice = 1
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
do
{
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
switch ($Result) switch ($Result)
{ {
"0" "0"
@ -2998,7 +2990,6 @@ switch ($Result)
{ {
Add-MpPreference -ExclusionPath $OpenFileDialog.FileName -Force Add-MpPreference -ExclusionPath $OpenFileDialog.FileName -Force
} }
$Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
} }
"1" "1"
{ {
@ -3012,6 +3003,8 @@ switch ($Result)
} }
} }
} }
}
until ($Result -eq 1)
# Turn on Windows Defender Exploit Guard network protection # Turn on Windows Defender Exploit Guard network protection
# Включить защиту сети в Windows Defender # Включить защиту сети в Windows Defender
@ -3036,30 +3029,27 @@ New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Security Health\State"
# Turn on events auditing generated when a process is created or starts # Turn on events auditing generated when a process is created or starts
# Включить аудит событий, возникающих при создании или запуске процесса # Включить аудит событий, возникающих при создании или запуске процесса
auditpol /set /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable auditpol /set /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable
$ProcessCreation = $true
# Include command line in process creation events <#
# Включать командную строку в событиях создания процесса Include command line in process creation events
In order this feature to work events auditing must be enabled
Включать командную строку в событиях создания процесса
Необходимо включить аудит событий, чтобы работала данная опция
#>
if ($RU) if ($RU)
{ {
$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 $OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8
} }
if ($ProcessCreation)
{
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -PropertyType DWord -Value 1 -Force New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -PropertyType DWord -Value 1 -Force
$ProcessCreationIncludeCmdLine_Enabled = $true
}
# Create "Process Creation" Event Viewer Custom View <#
# Создать настаиваемое представление "Создание процесса" в Просмотре событий Create "Process Creation" Event Viewer Custom View
if ($RU) In order this feature to work events auditing and command line in process creation events must be enabled
{
$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8
}
if ($ProcessCreation -and $ProcessCreationIncludeCmdLine_Enabled) Создать настаиваемое представление "Создание процесса" в Просмотре событий
{ Необходимо включить аудит событий и командную строку в событиях создания процесса, чтобы работала данная опция
#>
$XML = @" $XML = @"
<ViewerConfig> <ViewerConfig>
<QueryConfig> <QueryConfig>
@ -3094,7 +3084,6 @@ if ($ProcessCreation -and $ProcessCreationIncludeCmdLine_Enabled)
$XML.ViewerConfig.QueryConfig.QueryNode.Description = "События содания нового процесса и аудит командной строки" $XML.ViewerConfig.QueryConfig.QueryNode.Description = "События содания нового процесса и аудит командной строки"
$xml.Save("$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml") $xml.Save("$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml")
} }
}
# Turn on logging for all Windows PowerShell modules # Turn on logging for all Windows PowerShell modules
# Включить ведение журнала для всех модулей Windows PowerShell # Включить ведение журнала для всех модулей Windows PowerShell

72
Win 10 2004.ps1

@ -2,8 +2,8 @@
.SYNOPSIS .SYNOPSIS
"Windows 10 Setup Script" is a set of tweaks for OS fine-tuning and automating the routine tasks "Windows 10 Setup Script" is a set of tweaks for OS fine-tuning and automating the routine tasks
Version: v4.5.4 Version: v4.5.5
Date: 29.06.2020 Date: 07.07.2020
Copyright (c) 2020 farag & oZ-Zo Copyright (c) 2020 farag & oZ-Zo
Thanks to all http://forum.ru-board.com members involved Thanks to all http://forum.ru-board.com members involved
@ -20,6 +20,10 @@
Running the script is best done on a fresh install because running it on tweaked system may result in errors occurring Running the script is best done on a fresh install because running it on tweaked system may result in errors occurring
Some third-party antiviruses flag this script or its' part as malicious one. This is a false positive due to $EncodedScript variable
You can read more on section "Create a Windows cleaning up task in the Task Scheduler"
You might need to disable tamper protection from your antivirus settings,re-enable it after running the script, and reboot
Check whether the .ps1 file is encoded in UTF-8 with BOM Check whether the .ps1 file is encoded in UTF-8 with BOM
The script can not be executed via PowerShell ISE The script can not be executed via PowerShell ISE
PowerShell must be run with elevated privileges PowerShell must be run with elevated privileges
@ -2458,8 +2462,10 @@ if (Get-CimInstance -ClassName Win32_VideoController | Where-Object -FilterScrip
$Options = "&Add", "&Skip" $Options = "&Add", "&Skip"
} }
$DefaultChoice = 1 $DefaultChoice = 1
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
do
{
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
switch ($Result) switch ($Result)
{ {
"0" "0"
@ -2504,6 +2510,8 @@ if (Get-CimInstance -ClassName Win32_VideoController | Where-Object -FilterScrip
} }
} }
} }
until ($Result -eq 1)
}
<# <#
Turn on hardware-accelerated GPU scheduling. Restart needed Turn on hardware-accelerated GPU scheduling. Restart needed
@ -2795,8 +2803,10 @@ else
$Options = "&Add a protected folder", "&Skip" $Options = "&Add a protected folder", "&Skip"
} }
$DefaultChoice = 1 $DefaultChoice = 1
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
do
{
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
switch ($Result) switch ($Result)
{ {
"0" "0"
@ -2821,7 +2831,6 @@ switch ($Result)
Set-MpPreference -EnableControlledFolderAccess Enabled Set-MpPreference -EnableControlledFolderAccess Enabled
Add-MpPreference -ControlledFolderAccessProtectedFolders $FolderBrowserDialog.SelectedPath -Force Add-MpPreference -ControlledFolderAccessProtectedFolders $FolderBrowserDialog.SelectedPath -Force
} }
$Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
} }
"1" "1"
{ {
@ -2835,6 +2844,8 @@ switch ($Result)
} }
} }
} }
}
until ($Result -eq 1)
# Allow an app through Controlled folder access # Allow an app through Controlled folder access
# Разрешить работу приложения через контролируемый доступ к папкам # Разрешить работу приложения через контролируемый доступ к папкам
@ -2853,8 +2864,10 @@ if ((Get-MpPreference).EnableControlledFolderAccess -eq 1)
$Options = "&Add a protected folder", "&Skip" $Options = "&Add a protected folder", "&Skip"
} }
$DefaultChoice = 1 $DefaultChoice = 1
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
do
{
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
switch ($Result) switch ($Result)
{ {
"0" "0"
@ -2879,7 +2892,6 @@ if ((Get-MpPreference).EnableControlledFolderAccess -eq 1)
{ {
Add-MpPreference -ControlledFolderAccessAllowedApplications $OpenFileDialog.FileName -Force Add-MpPreference -ControlledFolderAccessAllowedApplications $OpenFileDialog.FileName -Force
} }
$Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
} }
"1" "1"
{ {
@ -2894,6 +2906,8 @@ if ((Get-MpPreference).EnableControlledFolderAccess -eq 1)
} }
} }
} }
until ($Result -eq 1)
}
# Add exclusion folder from Microsoft Defender Antivirus scanning # Add exclusion folder from Microsoft Defender Antivirus scanning
# Добавить папку в список исключений сканирования Microsoft Defender # Добавить папку в список исключений сканирования Microsoft Defender
@ -2910,8 +2924,10 @@ else
$Options = "&Exclude folder", "&Skip" $Options = "&Exclude folder", "&Skip"
} }
$DefaultChoice = 1 $DefaultChoice = 1
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
do
{
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
switch ($Result) switch ($Result)
{ {
"0" "0"
@ -2935,7 +2951,6 @@ switch ($Result)
{ {
Add-MpPreference -ExclusionPath $FolderBrowserDialog.SelectedPath -Force Add-MpPreference -ExclusionPath $FolderBrowserDialog.SelectedPath -Force
} }
$Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
} }
"1" "1"
{ {
@ -2949,6 +2964,8 @@ switch ($Result)
} }
} }
} }
}
until ($Result -eq 1)
# Add exclusion file from Microsoft Defender Antivirus scanning # Add exclusion file from Microsoft Defender Antivirus scanning
# Добавить файл в список исключений сканирования Microsoft Defender # Добавить файл в список исключений сканирования Microsoft Defender
@ -2965,8 +2982,10 @@ else
$Options = "&Exclude file", "&Skip" $Options = "&Exclude file", "&Skip"
} }
$DefaultChoice = 1 $DefaultChoice = 1
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
do
{
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
switch ($Result) switch ($Result)
{ {
"0" "0"
@ -2991,7 +3010,6 @@ switch ($Result)
{ {
Add-MpPreference -ExclusionPath $OpenFileDialog.FileName -Force Add-MpPreference -ExclusionPath $OpenFileDialog.FileName -Force
} }
$Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
} }
"1" "1"
{ {
@ -3005,6 +3023,8 @@ switch ($Result)
} }
} }
} }
}
until ($Result -eq 1)
# Turn on Microsoft Defender Exploit Guard network protection # Turn on Microsoft Defender Exploit Guard network protection
# Включить защиту сети в Microsoft Defender Exploit Guard # Включить защиту сети в Microsoft Defender Exploit Guard
@ -3029,30 +3049,27 @@ New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Security Health\State"
# Turn on events auditing generated when a process is created or starts # Turn on events auditing generated when a process is created or starts
# Включить аудит событий, возникающих при создании или запуске процесса # Включить аудит событий, возникающих при создании или запуске процесса
auditpol /set /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable auditpol /set /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable
$ProcessCreation = $true
# Include command line in process creation events <#
# Включать командную строку в событиях создания процесса Include command line in process creation events
In order this feature to work events auditing must be enabled
Включать командную строку в событиях создания процесса
Необходимо включить аудит событий, чтобы работала данная опция
#>
if ($RU) if ($RU)
{ {
$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 $OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8
} }
if ($ProcessCreation)
{
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -PropertyType DWord -Value 1 -Force New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -PropertyType DWord -Value 1 -Force
$ProcessCreationIncludeCmdLine_Enabled = $true
}
# Create "Process Creation" Event Viewer Custom View <#
# Создать настаиваемое представление "Создание процесса" в Просмотре событий Create "Process Creation" Event Viewer Custom View
if ($RU) In order this feature to work events auditing and command line in process creation events must be enabled
{
$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8
}
if ($ProcessCreation -and $ProcessCreationIncludeCmdLine_Enabled) Создать настаиваемое представление "Создание процесса" в Просмотре событий
{ Необходимо включить аудит событий и командную строку в событиях создания процесса, чтобы работала данная опция
#>
$XML = @" $XML = @"
<ViewerConfig> <ViewerConfig>
<QueryConfig> <QueryConfig>
@ -3087,7 +3104,6 @@ if ($ProcessCreation -and $ProcessCreationIncludeCmdLine_Enabled)
$XML.ViewerConfig.QueryConfig.QueryNode.Description = "События содания нового процесса и аудит командной строки" $XML.ViewerConfig.QueryConfig.QueryNode.Description = "События содания нового процесса и аудит командной строки"
$xml.Save("$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml") $xml.Save("$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml")
} }
}
# Turn on logging for all Windows PowerShell modules # Turn on logging for all Windows PowerShell modules
# Включить ведение журнала для всех модулей Windows PowerShell # Включить ведение журнала для всех модулей Windows PowerShell

Loading…
Cancel
Save