Cap WSB job history request at 100
Get-WBJob -Previous only accepts 1-100, so asking for 200 failed
collector setup on every run ("The 200 argument is greater than the
maximum allowed range of 100"). 100 still covers a 30-day backfill at
up to 3 backups a day. The mock now enforces the same range.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -92,7 +92,8 @@ $global:MockWsbSummary = [pscustomobject]@{
|
||||
CurrentOperationStatus = $(if ($WithRunningJob) { 'BackupInProgress' } else { 'NoOperationInProgress' })
|
||||
}
|
||||
|
||||
function Get-WBJob { param([int]$Previous) if ($PSBoundParameters.ContainsKey('Previous')) { $global:MockWsbPrevious } else { $global:MockWsbRunning } }
|
||||
# Same limit as the real cmdlet
|
||||
function Get-WBJob { param([ValidateRange(1, 100)][int]$Previous) if ($PSBoundParameters.ContainsKey('Previous')) { $global:MockWsbPrevious } else { $global:MockWsbRunning } }
|
||||
function Get-WBSummary { $global:MockWsbSummary }
|
||||
function Get-WBPolicy { [pscustomobject]@{ PolicyName = 'Scheduled' } }
|
||||
function Get-WBSchedule { param($Policy) @($global:MockWsbSummary.NextBackupTime) }
|
||||
|
||||
Reference in New Issue
Block a user