Skip to content

Fluent.TaskScheduler v1.0.0

Latest

Choose a tag to compare

@Cadtastic Cadtastic released this 08 Jun 20:51
· 2 commits to master since this release
9378e21

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 arguments
  • ExecutePowerShellScript() - Execute PowerShell script files
  • ExecutePowerShellCommands() - Run inline PowerShell commands
  • ExecuteBatchFile() - Run batch files or command scripts
  • ExecuteCommand() - Execute any command with arguments
  • ExecuteConsoleApp() - 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.