Can I set Powershell initial work with low priority?

I would like to lower the priority of jobs that I started by starting with Powershell scripts. Is it possible?

thanks

+7
source share
2 answers

I used this trick directly in the task code (it can be an additional parameter-driven one):

[System.Threading.Thread]::CurrentThread.Priority = 'Lowest' 

Available priority values: lowest, lower than normal, normal, higher than normal, highest

+4
source

If you run it, you can use this: -

  $a = gps powershell $a.PriorityClass = "BelowNormal" 

or you can use it using the key: -

  Get-WmiObject Win32_process -filter 'name = "notepad.exe"' | foreach-object { $_.SetPriority(32) } 

Priority codes are as follows: -

  256 REALTIME 128 HIGH_PRIORITY 32768 ABOVE_NORMAL 32 NORMAL 16384 BELOW_NORMAL 64 IDLE 
+5
source

All Articles