Skip to content

Commit

Permalink
22.10.2019
Browse files Browse the repository at this point in the history
## Updated
- Improved "Turn off Windows features" and "Turn off default background apps, except the followings..." sections
  - Total runtime reduced by ~ 10 sec.

## Обновлено
- Улучшены разделы "Отключить компоненты" и "Запретить стандартным приложениям работать в фоновом режиме, кроме следующих..."
  - Общее время выполнения сокращено примерно на 10 с
  • Loading branch information
farag2 authored Oct 22, 2019
1 parent 5a7d841 commit 623c095
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions Win 10.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -584,30 +584,27 @@ New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Windo
$features = @(
# Windows Fax and Scan
# Факсы и сканирование
"FaxServicesClientPackage",
"FaxServicesClientPackage"
# Legacy Components
# Компоненты прежних версий
"LegacyComponents",
"LegacyComponents"
# Media Features
# Компоненты работы с мультимедиа
"MediaPlayback",
"MediaPlayback"
# PowerShell 2.0
"MicrosoftWindowsPowerShellV2",
"MicrosoftWindowsPowershellV2Root",
"MicrosoftWindowsPowerShellV2"
"MicrosoftWindowsPowershellV2Root"
# Microsoft XPS Document Writer
# Средство записи XPS-документов (Microsoft)
"Printing-XPSServices-Features",
"Printing-XPSServices-Features"
# Microsoft Print to PDF
# Печать в PDF (Майкрософт)
"Printing-PrintToPDFServices-Features",
"Printing-PrintToPDFServices-Features"
# Work Folders Client
# Клиент рабочих папок
"WorkFolders-Client"
)
foreach ($feature in $features)
{
Disable-WindowsOptionalFeature -Online -FeatureName $feature -NoRestart
}
Disable-WindowsOptionalFeature -Online -FeatureName $features -NoRestart
# Remove Windows capabilities
# Удалить компоненты
$IncludedApps = @(
Expand Down Expand Up @@ -637,9 +634,9 @@ Get-CimInstance -ClassName Win32_ShadowCopy | Remove-CimInstance
# Turn off Windows Script Host
# Отключить Windows Script Host
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -PropertyType DWord -Value 0 -Force
# Turn off default background apps except
# Запретить стандартным приложениям работать в фоновом режиме, кроме
$apps = @(
# Turn off default background apps, except the followings...
# Запретить стандартным приложениям работать в фоновом режиме, кроме следующих...
$ExcludedApps = @(
# Lock App
"Microsoft.LockApp*"
# Content Delivery Manager
Expand All @@ -654,14 +651,13 @@ $apps = @(
# StartMenuExperienceHost
"Microsoft.Windows.StartMenuExperienceHost*"
)
foreach ($app in $apps)
{
Get-ChildItem -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications -Exclude $apps |
ForEach-Object -Process {
New-ItemProperty -Path $_.PsPath -Name Disabled -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path $_.PsPath -Name DisabledByUser -PropertyType DWord -Value 1 -Force
}
$OFS = "|"
Get-ChildItem -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications | Where-Object -FilterScript {$_.PSChildName -cnotmatch $ExcludedApps} |
ForEach-Object -Process {
New-ItemProperty -Path $_.PsPath -Name Disabled -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path $_.PsPath -Name DisabledByUser -PropertyType DWord -Value 1 -Force
}
$OFS = " "
# Set power management scheme for desktop and laptop
# Установить схему управления питания для стационарного ПК и ноутбука
IF ((Get-CimInstance -ClassName Win32_ComputerSystem).PCSystemType -eq 1)
Expand Down

0 comments on commit 623c095

Please sign in to comment.