Releases: blast752/smartperformance
Releases · blast752/smartperformance
SmartPerformance v0.2.0: Real-time Power Event Monitoring and Enhanced Efficiency
Pre-release
Added
- Functions have been created to increase modularity and readability:
Get-CurrentPowerPlanto get the current power plan.Check-PowerStatusto check the power status (connected or disconnected).
- A WMI event is registered to detect power management events and switch power plans dynamically in real-time without the need for a constant loop and sleep interval.
- This improves the efficiency of the script as it only reacts to power events instead of continuously checking the power status.
Changed
- The
Set-PowerPlanfunction has been modified to only change the power plan if the new plan GUID is different from the current one.- This prevents unnecessary power plan changes and reduces the number of log messages.
- The script now sets the initial power plan based on the current power status before starting to monitor power events.
- The script now continuously waits for power events using the
Wait-Eventcmdlet instead of using a loop with a sleep interval.
Removed
- The
Log-ScriptInfofunction and its invocation have been removed because is buggy. - The
Get-PowerSourcefunction has been replaced with theCheck-PowerStatusfunction, which returns a boolean value indicating whether the power source is connected or not. - The
Check-PowerProfileExistsandCreate-HighPerformancePlanfunctions have been removed, as the script assumes that the Balanced and High Performance power plans already exist on the system.
These changes make the new version of the script more efficient, easier to read, and more focused on its primary goal: automatically switching between Balanced and High Performance power plans based on the power source.