< Summary - Kestrun — Combined Coverage

Information
Class: Public.Scheduling.Resume-KrSchedule
Assembly: Kestrun.PowerShell.Public
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Scheduling/Resume-KrSchedule.ps1
Tag: Kestrun/Kestrun@9d3a582b2d63930269564a7591aa77ef297cadeb
Line coverage
0%
Covered lines: 0
Uncovered lines: 9
Coverable lines: 9
Total lines: 48
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

File(s)

/home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Scheduling/Resume-KrSchedule.ps1

#LineLine coverage
 1<#
 2    .SYNOPSIS
 3        Resumes a previously-paused schedule.
 4    .DESCRIPTION
 5        This function resumes a scheduled task that was previously paused.
 6    .PARAMETER Server
 7        The Kestrun host object that manages the schedule.
 8    .PARAMETER Name
 9        The name of the schedule to resume.
 10    .EXAMPLE
 11        Resume-KrSchedule -Name 'ps-inline'
 12        Resumes the schedule named 'ps-inline'.
 13    .OUTPUTS
 14        Returns the Kestrun host object after resuming the schedule.
 15    .NOTES
 16        This function is part of the Kestrun scheduling module.
 17#>
 18function Resume-KrSchedule {
 19    [KestrunRuntimeApi('Everywhere')]
 20    [CmdletBinding()]
 21    [OutputType([Kestrun.Hosting.KestrunHost])]
 22    param(
 23        [Parameter(Mandatory = $false, ValueFromPipeline = $true)]
 24        [Kestrun.Hosting.KestrunHost]$Server,
 25        [Parameter(Mandatory = $true)]
 26        [string]$Name
 27    )
 28    begin {
 29        # Ensure the server instance is resolved
 030        $Server = Resolve-KestrunServer -Server $Server
 031        if ($null -eq $Server) {
 032            throw 'Server is not initialized. Please ensure the server is configured before setting options.'
 33        }
 34    }
 35    process {
 036        if (-not $Server.Scheduler) {
 037            throw 'SchedulerService is not enabled.'
 38        }
 39
 040        if ($Server.Scheduler.Resume($Name)) {
 041            Write-Information "▶️ schedule '$Name' resumed."
 42        } else {
 043            Write-Warning "No schedule named '$Name' found."
 44        }
 045        return $Server
 46    }
 47}
 48

Methods/Properties

Resume-KrSchedule()