@@ -337,7 +337,8 @@ class SqlDatabase : SqlResourceBase
337337 $Collation
338338
339339 [DscProperty ()]
340- [DatabaseCompatibilityLevel ]
340+ [ValidateSet (' Version80' , ' Version90' , ' Version100' , ' Version110' , ' Version120' , ' Version130' , ' Version140' , ' Version150' , ' Version160' )]
341+ [System.String ]
341342 $CompatibilityLevel
342343
343344 [DscProperty ()]
@@ -601,7 +602,8 @@ class SqlDatabase : SqlResourceBase
601602
602603 # Enum properties (using string to avoid SMO type dependencies)
603604 [DscProperty ()]
604- [RetentionPeriodUnits ]
605+ [ValidateSet (' None' , ' Days' , ' Hours' , ' Minutes' )]
606+ [System.String ]
605607 $ChangeTrackingRetentionPeriodUnits
606608
607609 [DscProperty ()]
@@ -630,7 +632,8 @@ class SqlDatabase : SqlResourceBase
630632 $LegacyCardinalityEstimationForSecondary
631633
632634 [DscProperty ()]
633- [MirroringSafetyLevel ]
635+ [ValidateSet (' None' , ' Unknown' , ' Off' , ' Full' )]
636+ [System.String ]
634637 $MirroringSafetyLevel
635638
636639 [DscProperty ()]
@@ -742,7 +745,7 @@ class SqlDatabase : SqlResourceBase
742745 # Only set CompatibilityLevel if it's a valid non-zero value
743746 if ($databaseObject.CompatibilityLevel -gt 0 )
744747 {
745- $currentState.CompatibilityLevel = [ DatabaseCompatibilityLevel ] $databaseObject.CompatibilityLevel.ToString ()
748+ $currentState.CompatibilityLevel = $databaseObject.CompatibilityLevel.ToString ()
746749 }
747750
748751 $currentState.RecoveryModel = $databaseObject.RecoveryModel.ToString ()
@@ -858,11 +861,11 @@ class SqlDatabase : SqlResourceBase
858861 # Double properties
859862 $currentState.MaxSizeInBytes = [System.Double ] $databaseObject.MaxSizeInBytes
860863
861- # RetentionPeriodUnits enum (convert SMO enum to module enum )
862- $currentState.ChangeTrackingRetentionPeriodUnits = [ RetentionPeriodUnits ] $databaseObject.ChangeTrackingRetentionPeriodUnits.ToString ()
864+ # RetentionPeriodUnits (convert SMO enum to string )
865+ $currentState.ChangeTrackingRetentionPeriodUnits = $databaseObject.ChangeTrackingRetentionPeriodUnits.ToString ()
863866
864- # MirroringSafetyLevel enum (convert SMO enum to module enum )
865- $currentState.MirroringSafetyLevel = [ MirroringSafetyLevel ] $databaseObject.MirroringSafetyLevel.ToString ()
867+ # MirroringSafetyLevel (convert SMO enum to string )
868+ $currentState.MirroringSafetyLevel = $databaseObject.MirroringSafetyLevel.ToString ()
866869
867870 # Enum properties (convert to string with null check)
868871 $enumProperties = @ (
0 commit comments