@@ -447,37 +447,37 @@ function Get-TargetResource
447
447
$myPeriodOfflineBeforeAccessCheck = $policy.PeriodOfflineBeforeAccessCheck
448
448
if ($null -ne $policy.PeriodOfflineBeforeAccessCheck )
449
449
{
450
- $myPeriodOfflineBeforeAccessCheck = $policy.PeriodOfflineBeforeAccessCheck.toString ()
450
+ $myPeriodOfflineBeforeAccessCheck = $policy.PeriodOfflineBeforeAccessCheck.ToString ()
451
451
}
452
452
453
453
$myPeriodOnlineBeforeAccessCheck = $policy.PeriodOnlineBeforeAccessCheck
454
454
if ($null -ne $policy.PeriodOnlineBeforeAccessCheck )
455
455
{
456
- $myPeriodOnlineBeforeAccessCheck = $policy.PeriodOnlineBeforeAccessCheck.toString ()
456
+ $myPeriodOnlineBeforeAccessCheck = $policy.PeriodOnlineBeforeAccessCheck.ToString ()
457
457
}
458
458
459
459
$myPeriodOfflineBeforeWipeIsEnforced = $policy.PeriodOfflineBeforeWipeIsEnforced
460
460
if ($null -ne $policy.PeriodOfflineBeforeWipeIsEnforced )
461
461
{
462
- $myPeriodOfflineBeforeWipeIsEnforced = $policy.PeriodOfflineBeforeWipeIsEnforced.toString ()
462
+ $myPeriodOfflineBeforeWipeIsEnforced = $policy.PeriodOfflineBeforeWipeIsEnforced.ToString ()
463
463
}
464
464
465
465
$myPeriodBeforePinReset = $policy.PeriodBeforePinReset
466
466
if ($null -ne $policy.PeriodBeforePinReset )
467
467
{
468
- $myPeriodBeforePinReset = $policy.PeriodBeforePinReset.toString ()
468
+ $myPeriodBeforePinReset = $policy.PeriodBeforePinReset.ToString ()
469
469
}
470
470
471
471
$myPinRequiredInsteadOfBiometricTimeout = $policy.PinRequiredInsteadOfBiometricTimeout
472
472
if ($null -ne $policy.PinRequiredInsteadOfBiometricTimeout )
473
473
{
474
- $myPinRequiredInsteadOfBiometricTimeout = $policy.PinRequiredInsteadOfBiometricTimeout.toString ()
474
+ $myPinRequiredInsteadOfBiometricTimeout = $policy.PinRequiredInsteadOfBiometricTimeout.ToString ()
475
475
}
476
476
477
477
$myGracePeriodToBlockAppsDuringOffClockHours = $policy.gracePeriodToBlockAppsDuringOffClockHours
478
478
if ($null -ne $policy.gracePeriodToBlockAppsDuringOffClockHours )
479
479
{
480
- $myGracePeriodToBlockAppsDuringOffClockHours = $policy.gracePeriodToBlockAppsDuringOffClockHours.toString ()
480
+ $myGracePeriodToBlockAppsDuringOffClockHours = $policy.gracePeriodToBlockAppsDuringOffClockHours.ToString ()
481
481
}
482
482
483
483
$AllowedDataIngestionLocationsValue = @ ()
@@ -486,8 +486,26 @@ function Get-TargetResource
486
486
$AllowedDataIngestionLocationsValue = [String []]($policy.AllowedDataIngestionLocations )
487
487
}
488
488
489
+ $exemptedUniversalLinks = @ ()
490
+ if ($null -ne $policy.exemptedUniversalLinks )
491
+ {
492
+ $exemptedUniversalLinks = [String []]($policy.exemptedUniversalLinks )
493
+ }
494
+
495
+ $managedUniversalLinks = @ ()
496
+ if ($null -ne $policy.managedUniversalLinks )
497
+ {
498
+ $managedUniversalLinks = [String []]($policy.managedUniversalLinks )
499
+ }
500
+
501
+ $AllowedDataStorageLocations = @ ()
502
+ if ($null -ne $policy.AllowedDataStorageLocations )
503
+ {
504
+ $AllowedDataStorageLocations = [String []]($policy.AllowedDataStorageLocations )
505
+ }
506
+
489
507
return @ {
490
- Identity = $policy.id
508
+ Identity = $policy.Id
491
509
DisplayName = $policy.DisplayName
492
510
Description = $policy.Description
493
511
AllowedDataIngestionLocations = $AllowedDataIngestionLocationsValue
@@ -499,10 +517,10 @@ function Get-TargetResource
499
517
CustomDialerAppProtocol = [string ]$policy.customDialerAppProtocol
500
518
DeployedAppCount = $policy.deployedAppCount
501
519
DialerRestrictionLevel = [string ]$policy.dialerRestrictionLevel
502
- ExemptedUniversalLinks = $policy . exemptedUniversalLinks
520
+ ExemptedUniversalLinks = $exemptedUniversalLinks
503
521
GracePeriodToBlockAppsDuringOffClockHours = $myGracePeriodToBlockAppsDuringOffClockHours
504
522
IsAssigned = $policy.isAssigned
505
- ManagedUniversalLinks = $policy . managedUniversalLinks
523
+ ManagedUniversalLinks = $managedUniversalLinks
506
524
MaximumAllowedDeviceThreatLevel = [string ]$policy.maximumAllowedDeviceThreatLevel
507
525
MaximumRequiredOsVersion = [string ]$policy.maximumRequiredOsVersion
508
526
MaximumWarningOsVersion = [string ]$policy.maximumWarningOsVersion
@@ -537,7 +555,7 @@ function Get-TargetResource
537
555
SimplePinBlocked = $policy.SimplePinBlocked
538
556
MinimumPinLength = $policy.MinimumPinLength
539
557
PinCharacterSet = [String ]$policy.PinCharacterSet
540
- AllowedDataStorageLocations = [ String []] $policy . AllowedDataStorageLocations
558
+ AllowedDataStorageLocations = $ AllowedDataStorageLocations
541
559
ContactSyncBlocked = $policy.ContactSyncBlocked
542
560
PeriodBeforePinReset = $myPeriodBeforePinReset
543
561
FaceIdBlocked = $policy.FaceIdBlocked
@@ -979,7 +997,7 @@ function Set-TargetResource
979
997
if ($Ensure -eq ' Present' -and $currentPolicy.Ensure -eq ' Absent' )
980
998
{
981
999
Write-Verbose - Message " Creating new iOS App Protection Policy {$DisplayName }"
982
- $createParameters = ([Hashtable ]$PSBoundParameters ).clone ()
1000
+ $createParameters = ([Hashtable ]$PSBoundParameters ).Clone ()
983
1001
$createParameters.Remove (' Identity' )
984
1002
$createParameters.Remove (' Assignments' )
985
1003
$createParameters.Remove (' Apps' )
@@ -1001,7 +1019,7 @@ function Set-TargetResource
1001
1019
if (-not [String ]::IsNullOrEmpty($createParameters .$duration ))
1002
1020
{
1003
1021
Write-Verbose - Message " Parsing {$ ( $createParameters .$duration ) } into TimeSpan"
1004
- if ($createParameters .$duration.startswith (' P' ))
1022
+ if ($createParameters .$duration.Startswith (' P' ))
1005
1023
{
1006
1024
$timespan = [System.Xml.XmlConvert ]::ToTimeSpan($createParameters .$duration )
1007
1025
}
@@ -1016,8 +1034,8 @@ function Set-TargetResource
1016
1034
foreach ($exemptedAppProtocol in $ExemptedAppProtocols )
1017
1035
{
1018
1036
$myExemptedAppProtocols += @ {
1019
- Name = $exemptedAppProtocol.split (' :' )[0 ]
1020
- Value = $exemptedAppProtocol.split (' :' )[1 ]
1037
+ Name = $exemptedAppProtocol.Split (' :' )[0 ]
1038
+ Value = $exemptedAppProtocol.Split (' :' )[1 ]
1021
1039
}
1022
1040
}
1023
1041
$createParameters.ExemptedAppProtocols = $myExemptedAppProtocols
@@ -1039,7 +1057,7 @@ function Set-TargetResource
1039
1057
elseif ($Ensure -eq ' Present' -and $currentPolicy.Ensure -eq ' Present' )
1040
1058
{
1041
1059
Write-Verbose - Message " Updating existing iOS App Protection Policy {$DisplayName }"
1042
- $updateParameters = ([Hashtable ]$PSBoundParameters ).clone ()
1060
+ $updateParameters = ([Hashtable ]$PSBoundParameters ).Clone ()
1043
1061
$updateParameters.Remove (' Identity' )
1044
1062
$updateParameters.Remove (' Assignments' )
1045
1063
$updateParameters.Remove (' Apps' )
@@ -1069,15 +1087,15 @@ function Set-TargetResource
1069
1087
{
1070
1088
if (-not [String ]::IsNullOrEmpty($updateParameters .$duration ))
1071
1089
{
1072
- $updateParameters .$duration = [TimeSpan ]::parse ($updateParameters .$duration )
1090
+ $updateParameters .$duration = [TimeSpan ]::Parse ($updateParameters .$duration )
1073
1091
}
1074
1092
}
1075
1093
$myExemptedAppProtocols = @ ()
1076
1094
foreach ($exemptedAppProtocol in $ExemptedAppProtocols )
1077
1095
{
1078
1096
$myExemptedAppProtocols += @ {
1079
- Name = $exemptedAppProtocol.split (' :' )[0 ]
1080
- Value = $exemptedAppProtocol.split (' :' )[1 ]
1097
+ Name = $exemptedAppProtocol.Split (' :' )[0 ]
1098
+ Value = $exemptedAppProtocol.Split (' :' )[1 ]
1081
1099
}
1082
1100
}
1083
1101
$updateParameters.ExemptedAppProtocols = $myExemptedAppProtocols
@@ -1471,7 +1489,7 @@ function Test-TargetResource
1471
1489
Write-Verbose - Message " Current Values: $ ( Convert-M365DscHashtableToString - Hashtable $CurrentValues ) "
1472
1490
Write-Verbose - Message " Target Values: $ ( Convert-M365DscHashtableToString - Hashtable $PSBoundParameters ) "
1473
1491
1474
- $ValuesToCheck = ([Hashtable ]$PSBoundParameters ).clone ()
1492
+ $ValuesToCheck = ([Hashtable ]$PSBoundParameters ).Clone ()
1475
1493
$ValuesToCheck.Remove (' Identity' )
1476
1494
1477
1495
$TestResult = Test-M365DSCParameterState - CurrentValues $CurrentValues `
0 commit comments