[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[转载代码] [PowerShell每日技巧]降低PowerShell进程的优先级(20140102)

When you run a PowerShell task, by default it has normal priority, and if the things your script does are CPU intensive, the overall performance of your machine may be affected.

To prevent this, you can assign your PowerShell process a lower priority and have it run only when CPU load allows. This will ensure that your PowerShell task won't degrade performance of other tasks.

This sample sets the priority to "below normal". You can also set it to "Idle" in which case your PowerShell script would only run when the machine has nothing else to do:

$process = Get-Process -Id $pid
$process.PriorityClass = 'BelowNormal'

http://powershell.com/cs/blogs/tips/archive/2014/01/02/lowering-powershell-process-priority.aspx

返回列表