Repository navigation
Fluent.TaskScheduler
A comprehensive .NET 8 library providing a fluent API for Windows Task Scheduler management with enterprise-grade reliability and performance optimization.
Key Features
- Fluent API: Clean, intuitive interface for creating and managing scheduled tasks
- Multiple Execution Types: Support for programs, PowerShell scripts, batch files, commands, and .NET console apps
- Flexible Scheduling: One-time and recurring schedules (minutes, hours, days, weeks)
- Enterprise Ready: Dependency injection, structured logging, retry policies, and connection pooling
- Strong Naming: Signed assemblies for enterprise compatibility
- Comprehensive Error Handling: Detailed exception hierarchy with specific error types
- Performance Monitoring: Built-in health checks and metrics
Quick Start
// Add to DI container
services.AddFluentTaskScheduler();
// Create a scheduled task
await taskScheduler.CreateTask("Daily Backup")
.WithDescription("Backs up important files")
.Category("Maintenance")
.ExecutePowerShellScript(@"C:\Scripts\Backup.ps1")
.RunEveryDays(1)
.StartingAt(DateTime.Today.AddHours(2))
.RunAsCurrentUser()
.CreateAsync();Execution Methods
ExecuteProgram()- Run any executable with argumentsExecutePowerShellScript()- Execute PowerShell script filesExecutePowerShellCommands()- Run inline PowerShell commandsExecuteBatchFile()- Run batch files or command scriptsExecuteCommand()- Execute any command with argumentsExecuteConsoleApp()- Run .NET console applications (.exe/.dll)
Requirements
- .NET 8.0+
- Windows OS
- Windows Task Scheduler service
Perfect for applications requiring reliable task automation, system maintenance, data processing, and scheduled operations in Windows environments.