Skip to content

Commit 2bc0c8e

Browse files
committed
fix(standards): cast retention days to integer
Convert `AgeLimitForRetention` from `TimeSpan.TotalDays` to an integer before state comparison in `Invoke-CIPPStandardRetentionPolicyTag`. This avoids decimal day values causing false drift detection when validating retention policy tag settings.
1 parent a557f51 commit 2bc0c8e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/CIPPStandards/Public/Standards/Invoke-CIPPStandardRetentionPolicyTag.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function Invoke-CIPPStandardRetentionPolicyTag {
5959
}
6060

6161
$CurrentAgeLimitForRetention = if ($CurrentState.AgeLimitForRetention) {
62-
([timespan]$CurrentState.AgeLimitForRetention).TotalDays
62+
[int]([timespan]$CurrentState.AgeLimitForRetention).TotalDays
6363
}
6464

6565
$StateIsCorrect = ($CurrentState.Name -eq $PolicyName) -and

0 commit comments

Comments
 (0)