Skip to content

Commit

Permalink
Merge pull request #3416 from NikCharlebois/Fixes-#3407
Browse files Browse the repository at this point in the history
Fixes #3407
  • Loading branch information
NikCharlebois authored Jun 26, 2023
2 parents 1fb2988 + 9ee61e8 commit 5505c22
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

# UNRELEASED

* EXOAvailabilityConfig
* Fixes an error where an error was thrown when the OrgWideAccount wasn't set.
FIXES [#3402](https://github.com/microsoft/Microsoft365DSC/issues/3402)
* IntuneDeviceEnrollmentPlatformRestriction
* Fixes an error where the WindowsMobileRestriction property was still being assessed dispite it being deprecated.
FIXES [#3407](https://github.com/microsoft/Microsoft365DSC/issues/3407)

* DEPENDENCIES
* Updated ReverseDSC to version 2.0.0.16.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,6 @@ function Get-TargetResource
{
$config = Get-MgDeviceManagementDeviceEnrollmentConfiguration -DeviceEnrollmentConfigurationId $Identity -ErrorAction silentlyContinue

<#
Not using the DisplayName as a key due to android profiles
Android profile are generated using 2 singlePlatformRestriction policies: 1 for android and 1 for androidForWork
Both policies have the same name
if ($null -eq $config)
{
Write-Verbose -Message "No Device Enrollment Platform Restriction {$Identity} was found"
$config = Get-MgDeviceManagementDeviceEnrollmentConfiguration -Filter "displayName eq '$DisplayName'" -ErrorAction silentlyContinue| Where-Object -FilterScript { `
$_.AdditionalProperties.'@odata.type' -like '#microsoft.graph.deviceEnrollmentPlatform*Configuration' }
}
#>

if ($null -eq $config)
{
Write-Verbose -Message "No Device Enrollment Platform Restriction {$Identity} was found"
Expand Down Expand Up @@ -536,7 +522,7 @@ function Test-TargetResource
{
$source = $PSBoundParameters.$key
$target = $CurrentValues.$key
if ($source.getType().Name -like '*CimInstance*')
if ($source.getType().Name -like '*CimInstance*' -and $key -ne 'WindowsMobileRestriction')
{
$source = Get-M365DSCDRGComplexTypeToHashtable -ComplexObject $source

Expand All @@ -551,7 +537,6 @@ function Test-TargetResource
}

$ValuesToCheck.Remove($key) | Out-Null

}
}

Expand All @@ -560,9 +545,7 @@ function Test-TargetResource
$ValuesToCheck.Remove('TenantId') | Out-Null
$ValuesToCheck.Remove('ApplicationSecret') | Out-Null
$ValuesToCheck.Remove('Id') | Out-Null

#Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
#Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $ValuesToCheck)"
$ValuesToCheck.Remove('WindowsMobileRestriction') | Out-Null

#Convert any DateTime to String
foreach ($key in $ValuesToCheck.Keys)
Expand All @@ -574,9 +557,12 @@ function Test-TargetResource
}
}

Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
#Compare basic parameters
if ($testResult)
{
Write-Verbose -Message "Comparing the current values with the desired ones"
$testResult = Test-M365DSCParameterState -CurrentValues $CurrentValues `
-Source $($MyInvocation.MyCommand.Source) `
-DesiredValues $PSBoundParameters `
Expand Down Expand Up @@ -959,8 +945,6 @@ function Get-DevicePlatformRestrictionSetting
}
}
$results.add($keyName, $hash)

#$results.add($keyName,[Hashtable]::new($platformRestrictions.$key))
}
}

Expand Down

0 comments on commit 5505c22

Please sign in to comment.