Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3407 #3416

Merged
merged 2 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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