This PowerShell script monitors CPU usage and takes action if it exceeds a specified threshold. If the CPU usage remains at or above the threshold for 2 minutes, it executes another PowerShell script (cpu.ps1
).
-
Ensure PowerShell is installed on your system.
-
Clone this repository:
git clone https://github.com/marz-hunter/climit.git
-
Navigate to the cloned directory:
cd climit
-
Run the
cpumonitor.ps1
script:.\cpumonitor.ps1
Customize the following parameters in the script:
$threshold
: CPU usage threshold that triggers the action.$waitTime
: Time to wait (in seconds) before executingchromelimit.ps1
if CPU usage remains high.
Adjust file paths and script names according to your project structure and requirements.
This project is licensed under the MIT License.