Skip to content

Commit 8bfa86c

Browse files
authored
v4.5.0.1 11.06.2020
## Windows 10 2004 Version ## Updated - Updated "Remove Windows capabilities" section - Moved Notepad from the $CheckedCapabilities variable to the $ExcludedCapabilities - To restore uninstalled Notepad execute ```powershell Get-WindowsCapability -Online -Name Microsoft.Windows.Notepad* | Add-WindowsCapability -Online -Verbose ``` - Updated "Turn on hardware-accelerated GPU scheduling" section - Added determining whether an OS is not installed on a virtual machine ## Версия для Windows 10 2004 ## Обновлено - Обновлен раздел "Удалить дополнительные компоненты Windows" - Компонент "Блокнот" перемещен из переменной $CheckedCapabilities в переменную $ExcludedCapabilities - Чтобы восстановить удаленный Блокнот, выполните ```powershell Get-WindowsCapability -Online -Name Microsoft.Windows.Notepad* | Add-WindowsCapability -Online -Verbose ``` - Обновлен раздел "Включить планирование графического процессора с аппаратным ускорением" - Добавлена проверка не установлена ли ОС на виртуальной машине
1 parent 8ac813b commit 8bfa86c

File tree

1 file changed

+34
-24
lines changed

1 file changed

+34
-24
lines changed

Win 10 2004.ps1

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -957,9 +957,6 @@ $CheckedCapabilities = @(
957957
"Media.WindowsMediaPlayer*"
958958
# Microsoft Paint
959959
"Microsoft.Windows.MSPaint*"
960-
# Notepad
961-
# Блокнот
962-
"Microsoft.Windows.Notepad*"
963960
# WordPad
964961
"Microsoft.Windows.WordPad*"
965962
# Integrated faxing and scanning application for Windows
@@ -975,16 +972,19 @@ if ((Get-CimInstance -ClassName Win32_ComputerSystem).PCSystemType -ne 2)
975972
$CheckedCapabilities += "Hello.Face*"
976973
}
977974
# Windows capabilities that will be shown in the form
978-
# Дополнительные компоненты Windows, которые будут выводиться в form
975+
# Дополнительные компоненты Windows, которые будут выводиться в форме
979976
$ExcludedCapabilities = @(
980977
# The DirectX Database to configure and optimize apps when multiple Graphics Adapters are present
981978
# База данных DirectX для настройки и оптимизации приложений при наличии нескольких графических адаптеров
982979
"DirectX\.Configuration\.Database"
983980
# Language components
984981
# Языковые компоненты
985982
"Language\."
983+
# Notepad
984+
# Блокнот
985+
"Microsoft.Windows.Notepad*"
986986
# Mail, contacts, and calendar sync component
987-
# Компонент синхронизации почты, контактов и календаря.
987+
# Компонент синхронизации почты, контактов и календаря
988988
"OneCoreUAP\.OneSync"
989989
# Management of printers, printer drivers, and printer servers
990990
# Управление принтерами, драйверами принтеров и принт-серверами
@@ -1261,7 +1261,7 @@ if (Get-WindowsEdition -Online | Where-Object -FilterScript {$_.Edition -eq "Pro
12611261
{
12621262
try
12631263
{
1264-
# Checking whether a Hyper-V is enabled
1264+
# Determining whether a Hyper-V is enabled
12651265
# Проверка: включен ли Hyper-V
12661266
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent -eq $true)
12671267
{
@@ -1414,8 +1414,8 @@ function UserShellFolder
14141414
"IconFile=%SystemRoot%\system32\shell32.dll","IconIndex=-238"
14151415
}
14161416

1417-
# Checking the current user folder path
1418-
# Проверяем текущее значение пути пользовательской папки
1417+
# Determining the current user folder path
1418+
# Определяем текущее значение пути пользовательской папки
14191419
$UserShellFolderRegValue = Get-ItemPropertyValue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name $UserShellFoldersRegName[$UserFolder]
14201420
if ($UserShellFolderRegValue -ne $FolderPath)
14211421
{
@@ -2526,16 +2526,26 @@ if (Get-CimInstance -ClassName Win32_VideoController | Where-Object -FilterScrip
25262526
}
25272527
}
25282528

2529-
# Turn on hardware-accelerated GPU scheduling. Restart needed
2530-
# Включить планирование графического процессора с аппаратным ускорением. Необходима перезагрузка
2529+
<#
2530+
Turn on hardware-accelerated GPU scheduling. Restart needed
2531+
Determining whether the PC has a dedicated GPU to use this feature
2532+
2533+
Включить планирование графического процессора с аппаратным ускорением. Необходима перезагрузка
2534+
Определяем, имеется ли у ПК внешняя видеокарта для использования данной функции
2535+
#>
25312536
if ((Get-CimInstance -ClassName CIM_VideoController | Where-Object -FilterScript {$_.AdapterDACType -ne "Internal"}))
25322537
{
2533-
# Checking whether a WDDM verion is 2.7 or higher
2534-
# Проверка: имеет ли WDDM версию 2.7 или выше
2535-
$WddmVersion_Min = Get-ItemPropertyValue -Path HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\FeatureSetUsage -Name WddmVersion_Min
2536-
if ($WddmVersion_Min -ge 2700)
2538+
# Determining whether an OS is not installed on a virtual machine
2539+
# Проверяем, не установлена ли ОС на виртуальной машине
2540+
if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual")
25372541
{
2538-
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force
2542+
# Checking whether a WDDM verion is 2.7 or higher
2543+
# Проверка: имеет ли WDDM версию 2.7 или выше
2544+
$WddmVersion_Min = Get-ItemPropertyValue -Path HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\FeatureSetUsage -Name WddmVersion_Min
2545+
if ($WddmVersion_Min -ge 2700)
2546+
{
2547+
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force
2548+
}
25392549
}
25402550
}
25412551
#endregion Gaming
@@ -2644,18 +2654,18 @@ $SourceMainWindowHandle = (Get-Process -Name cleanmgr).MainWindowHandle
26442654
function MinimizeWindow
26452655
{
26462656
[CmdletBinding()]
2647-
Param
2657+
param
26482658
(
26492659
[Parameter(Mandatory = $true)]
2650-
$Process
2660+
$Process
26512661
)
2652-
$ShowWindowAsync = @{
2653-
Namespace = "WinAPI"
2654-
Name = "Win32ShowWindowAsync"
2655-
Language = "CSharp"
2656-
MemberDefinition = @"
2657-
[DllImport("user32.dll")]
2658-
public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
2662+
$ShowWindowAsync = @{
2663+
Namespace = "WinAPI"
2664+
Name = "Win32ShowWindowAsync"
2665+
Language = "CSharp"
2666+
MemberDefinition = @"
2667+
[DllImport("user32.dll")]
2668+
public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
26592669
"@
26602670
}
26612671
if (-not ("WinAPI.Win32ShowWindowAsync" -as [type]))

0 commit comments

Comments
 (0)