In some situations you need to stress your system a little (for example: to check if your monitoring is functioning properly.)
Installing some random .exe files from some anonymous websites is not always a good idea. So hereby a little script for blowing your CPU to 100%.
The script creates a nice calculation for all of your “Windows Logical Processors”
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 |
$NumberOfLogicalProcessors = Get-WmiObject win32_processor | Select-Object -ExpandProperty NumberOfLogicalProcessors ForEach ($core in 1..$NumberOfLogicalProcessors){ start-job -ScriptBlock{ $result = 1; foreach ($loopnumber in 1..2147483647){ $result=1; foreach ($loopnumber1 in 1..2147483647){ $result=1; foreach($number in 1..2147483647){ $result = $result * $number } } $result } } } Read-Host "Press any key to exit..." Stop-Job * |
Thanks. I used it in my environment and it works fine :).