@@ -520,28 +520,28 @@ function Set-TargetResource
520
520
521
521
if ($RepetitionDuration -lt $RepeatInterval )
522
522
{
523
- New-InvalidArgumentException `
523
+ New-ArgumentException `
524
524
- Message ($script :localizedData.RepetitionDurationLessThanIntervalError -f $RepetitionDuration , $RepeatInterval ) `
525
525
- ArgumentName RepeatInterval
526
526
}
527
527
528
528
if ($ScheduleType -eq ' Daily' -and $DaysInterval -eq 0 )
529
529
{
530
- New-InvalidArgumentException `
530
+ New-ArgumentException `
531
531
- Message ($script :localizedData.DaysIntervalError -f $DaysInterval ) `
532
532
- ArgumentName DaysInterval
533
533
}
534
534
535
535
if ($ScheduleType -eq ' Weekly' -and $WeeksInterval -eq 0 )
536
536
{
537
- New-InvalidArgumentException `
537
+ New-ArgumentException `
538
538
- Message ($script :localizedData.WeeksIntervalError -f $WeeksInterval ) `
539
539
- ArgumentName WeeksInterval
540
540
}
541
541
542
542
if ($ScheduleType -eq ' Weekly' -and $DaysOfWeek.Count -eq 0 )
543
543
{
544
- New-InvalidArgumentException `
544
+ New-ArgumentException `
545
545
- Message ($script :localizedData.WeekDayMissingError ) `
546
546
- ArgumentName DaysOfWeek
547
547
}
@@ -554,29 +554,29 @@ function Set-TargetResource
554
554
}
555
555
catch
556
556
{
557
- New-InvalidArgumentException `
557
+ New-ArgumentException `
558
558
- Message ($script :localizedData.OnEventSubscriptionError ) `
559
559
- ArgumentName EventSubscription
560
560
}
561
561
}
562
562
563
563
if ($ScheduleType -eq ' OnSessionState' -and [System.String ]::IsNullOrEmpty($StateChange ))
564
564
{
565
- New-InvalidArgumentException `
565
+ New-ArgumentException `
566
566
- Message ($script :localizedData.OnSessionStateChangeError ) `
567
567
- ArgumentName StateChange
568
568
}
569
569
570
570
if ($ExecuteAsGMSA -and ($ExecuteAsCredential -or $BuiltInAccount ))
571
571
{
572
- New-InvalidArgumentException `
572
+ New-ArgumentException `
573
573
- Message ($script :localizedData.gMSAandCredentialError ) `
574
574
- ArgumentName ExecuteAsGMSA
575
575
}
576
576
577
577
if ($SynchronizeAcrossTimeZone -and ($ScheduleType -notin @ (' Once' , ' Daily' , ' Weekly' )))
578
578
{
579
- New-InvalidArgumentException `
579
+ New-ArgumentException `
580
580
- Message ($script :localizedData.SynchronizeAcrossTimeZoneInvalidScheduleType ) `
581
581
- ArgumentName SynchronizeAcrossTimeZone
582
582
}
@@ -832,7 +832,7 @@ function Set-TargetResource
832
832
833
833
if ($RepetitionDuration -le $RepeatInterval )
834
834
{
835
- New-InvalidArgumentException `
835
+ New-ArgumentException `
836
836
- Message ($script :localizedData.RepetitionIntervalError -f $RepeatInterval , $RepetitionDuration ) `
837
837
- ArgumentName RepetitionDuration
838
838
}
0 commit comments