Skip to content

Commit

Permalink
refactor(svchost split): make readable
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Oct 4, 2024
1 parent e3e96a0 commit 7b9fb21
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,12 @@ description: Disables Service Host splitting for much lower RAM usage and proces
actions:
# https://learn.microsoft.com/en-us/windows/application-management/svchost-service-refactoring
- !powerShell:
command: 'Get-ChildItem "HKLM:\SYSTEM\CurrentControlSet\Services" | ? { $_.Name -notmatch ''Xbl|Xbox'' } | % { $a = Get-ItemProperty -Path "REGISTRY::$_" -EA SilentlyContinue; if ($null -ne $a.Start) { Set-ItemProperty -Path "Registry::$_" -Name "SvcHostSplitDisable" -Type DWORD -Value 1 -Force -EA SilentlyContinue } }'
command: |
Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Services' |
Where-Object { $_.Name -notmatch 'Xbl|Xbox' } |
Foreach-Object {
if ($null -ne (Get-ItemProperty -Path """Registry::$_""" -EA 0).Start) {
Set-ItemProperty -Path """Registry::$_""" -Name 'SvcHostSplitDisable' -Type DWORD -Value 1 -Force -EA 0 -WhatIf
}
}
wait: true

0 comments on commit 7b9fb21

Please sign in to comment.