1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
| <#
************************************************************************
Commentaire en fin de code
________________________________________________________________________
Le numerique est plus court , pas forcement plus lisible...
Vu le peut d'instruction le choix est numerique.
Variable global
#>
$P6 = 256 #real time
$P5 = 128 #high priority
$P4 = 32768 #above normal
$P3 = 32 #normal
$P2 = 16384 #below normal
$P1 = 64 #idle
$CORE_1=1
$CORE_2=2
$CORE_3=4
$CORE_4=8
$CORE_5=16
$CORE_6=32
$CORE_7=64
$CORE_8=128
$CORE_ALL=255
#code
function MySwitchPriority($Name, $P){
#ne gère pas les erreur si un process n'existe pas
$MesProcess = Get-WmiObject Win32_process -filter "name = ""$Name"""
foreach ($OneProcess in $MesProcess){
write-host $OneProcess.priority
$OneProcess.SetPriority($P) > $null
}
}
function MyCore($SetName, $C){
write-output $SetName
if((get-process $SetName -ea SilentlyContinue) -eq $Null)
{
write-output "MyCore: Processus introuvable $SetName"
return
}
$GetProcess = Get-Process $SetName -ErrorAction SilentlyContinue
$GetProcess | Foreach-Object {$_.ProcessorAffinity=$C} > $null
}
#profile par fonction....
function NoGame(){
Write-output "Profile NoGame"
MySwitchPriority "Calculator.exe" $P3
MySwitchPriority "brave.exe" $P3
MySwitchPriority "SteamService.exe" $P3
MySwitchPriority "steamwebhelper.exe" $P3
MySwitchPriority "Discord.exe" $P3
MySwitchPriority "SynTPEnh.exe" $P1
MySwitchPriority "SynTPHelper.exe" $P1
MySwitchPriority "Last Epoch.exe" $P1
MyCore "Calculator" $CORE_4
MyCore "brave" $CORE_ALL
MyCore "SteamService" $CORE_ALL
MyCore "steamwebhelper" $CORE_ALL
MyCore "Discord" $CORE_ALL
MyCore "SynTPEnh" $CORE_ALL
MyCore "SynTPHelper" $CORE_ALL
MyCore "Last Epoch" $CORE_8
}
function Game(){
Write-output "Profile Game"
MySwitchPriority "Calculator.exe" $P1
MySwitchPriority "brave.exe" $P1
MySwitchPriority "SteamService.exe" $P1
MySwitchPriority "steamwebhelper.exe" $P1
MySwitchPriority "Discord.exe" $P2
MySwitchPriority "SynTPEnh.exe" $P1
MySwitchPriority "SynTPHelper.exe" $P1
MySwitchPriority "KillerService.exe" $P1
MySwitchPriority "Last Epoch.exe" $P3
MyCore "Calculator" $CORE_8
MyCore "brave" $CORE_8
MyCore "SteamService" $CORE_8
MyCore "steamwebhelper" $CORE_8
MyCore "Discord" $CORE_8
MyCore "SynTPEnh" $CORE_8
MyCore "SynTPHelper" $CORE_8
MyCore "KillerService" $CORE_8
MyCore "Last Epoch" $CORE_ALL
}
function Brave(){
Write-output "Profile Brave"
MySwitchPriority "Calculator.exe" $P2
MySwitchPriority "brave.exe" $P3
MySwitchPriority "SteamService.exe" $P2
MySwitchPriority "steamwebhelper.exe" $P2
MySwitchPriority "Discord.exe" $P2
MySwitchPriority "SynTPEnh.exe" $P2
MySwitchPriority "SynTPHelper.exe" $P2
MySwitchPriority "KillerService.exe" $P1
MySwitchPriority "Last Epoch.exe" $P1
MyCore "Calculator" $CORE_8
MyCore "brave" $CORE_ALL
MyCore "SteamService" $CORE_8
MyCore "steamwebhelper" $CORE_8
MyCore "Discord" $CORE_7
MyCore "SynTPEnh" $CORE_8
MyCore "SynTPHelper" $CORE_8
MyCore "KillerService" $CORE_8
MyCore "Last Epoch" $CORE_8
}
function BraveDiscord(){
Write-output "Profile BraveDiscord"
MySwitchPriority "Calculator.exe" $P1
MySwitchPriority "brave.exe" $P3
MySwitchPriority "SteamService.exe" $P1
MySwitchPriority "steamwebhelper.exe" $P1
MySwitchPriority "Discord.exe" $P3
MySwitchPriority "SynTPEnh.exe" $P1
MySwitchPriority "SynTPHelper.exe" $P1
MySwitchPriority "KillerService.exe" $P1
MySwitchPriority "Last Epoch.exe" $P1
MyCore "Calculator" $CORE_8
MyCore "brave" $CORE_ALL
MyCore "SteamService" $CORE_8
MyCore "steamwebhelper" $CORE_8
MyCore "Discord" $CORE_ALL
MyCore "SynTPEnh" $CORE_8
MyCore "SynTPHelper" $CORE_8
MyCore "KillerService" $CORE_8
MyCore "Last Epoch" $CORE_8
}
#Choix du profile
NoGame
#Game
#Brave
#BraveDiscord
<#_______________________________________________________________________
#
Attention aud droit du systeme, certin message sont igniorer,
Ce code n'est ni optimiser ni fait dans ce but, juste fonctionnel.
Ne pas placer ceci aux demarrage de la machine sans en comprendre
les concequances.#real time sur un processus lourd peut fortement
impacter le demrarrage.
Merci a ceux qui mon indirectement aider sur le net par leur tutoriel:)
Devloppeur, panthere noire
#> |
Partager