Skip to content

StayActive

Latest
Compare
Choose a tag to compare
@virtualox virtualox released this 28 May 08:11
44ea19c

Changelog

[3.0.0] - 2025-05-28

Added

  • Professional Command-Line Interface: Full parameter support with [CmdletBinding()] for PowerShell best practices
  • Built-in Help System: Comprehensive -Help parameter with detailed usage examples and syntax
  • Progress Indicators: Real-time progress display showing movement count, runtime, and next movement timing
  • Enhanced Verbose Logging: Timestamped detailed logging using PowerShell's native Write-Verbose
  • Parameter Validation: Input validation for all parameters with helpful error messages
  • Mouse Position Tracking: Advanced cursor position monitoring for detailed logging
  • Runtime Statistics: Comprehensive summary showing total runtime, movements, and average intervals
  • Professional Output Formatting: Color-coded startup banners and termination summaries
  • Graceful Error Handling: Proper exception handling with detailed error reporting
  • Configurable Movement Distance: Adjustable pixel movement (1-10 pixels) with validation

Changed

  • Major Architecture Overhaul: Complete rewrite from simple loop to professional PowerShell cmdlet
  • Default Interval: Increased from 1 second to 60 seconds for more realistic usage patterns
  • Logging System: Replaced custom logging with PowerShell's standard Write-Verbose functionality
  • Parameter Structure: Moved from hardcoded values to full command-line parameter support
  • Output Format: Enhanced from minimal output to comprehensive user feedback
  • Error Handling: Upgraded from basic try-catch to comprehensive exception management

Enhanced

  • Code Quality: Implemented PowerShell best practices and proper cmdlet structure
  • User Experience: Added professional startup/shutdown sequences with detailed information
  • Monitoring Capabilities: Extensive logging and progress tracking for production environments
  • Customization Options: Multiple parameters for different use cases and environments
  • Documentation: Comprehensive inline help and parameter descriptions

Security

  • Code Signing: Script is digitally signed with Extended Validation (EV) Code Signing Certificate
  • Parameter Validation: Input sanitization and bounds checking to prevent misuse
  • Execution Policy: Proper PowerShell execution policy handling and guidance

Technical Improvements

  • Windows API Integration: Enhanced API calls with proper error handling
  • Memory Management: Improved resource usage and cleanup procedures
  • Performance Optimization: Efficient timing and movement algorithms
  • Compatibility: Tested with PowerShell 5.1 and PowerShell Core 6.0+

Usage Examples

# Basic usage with default settings
.\StayActive.ps1

# Show progress indicators
.\StayActive.ps1 -ShowProgress

# Custom interval with verbose logging
.\StayActive.ps1 -MoveInterval 30 -Verbose

# Full features for monitoring
.\StayActive.ps1 -MoveInterval 45 -SmallMove 2 -ShowProgress -Verbose

# Display help information
.\StayActive.ps1 -Help

Breaking Changes

  • Parameter Names: All configuration now requires explicit parameters instead of editing script variables
  • Output Format: Completely redesigned output may affect automated parsing
  • Timing: Default interval changed from 1 second to 60 seconds
  • Execution: Requires PowerShell parameter syntax instead of direct execution

Migration Guide

From v1.0.0 to v3.0.0:

  • Replace direct script execution with parameter-based usage
  • Update any automation scripts to use new parameter names
  • Adjust timing expectations due to new default 60-second interval
  • Review verbose output if used for monitoring or logging

Notes

  • The script maintains backward compatibility for basic mouse movement functionality
  • All new features are optional and don't affect core functionality when using defaults
  • Enhanced security through code signing and parameter validation
  • Comprehensive documentation available via -Help parameter