diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a74890159..b43777b491 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ # UNRELEASED +* IntuneDeviceEnrollmentStatusPageWindows10 + * Fix typo in the catch of Update-DeviceEnrollmentConfigurationPriority + Fixes [#3442](https://github.com/microsoft/Microsoft365DSC/issues/3442) + * M365DSCDRGUTIL * Fix an issue where temporary parameters were not renamed during recursive call causing a Model Validation error during creation or update of a Graph resource Fixes [#3582](https://github.com/microsoft/Microsoft365DSC/issues/3582) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceEnrollmentStatusPageWindows10/MSFT_IntuneDeviceEnrollmentStatusPageWindows10.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceEnrollmentStatusPageWindows10/MSFT_IntuneDeviceEnrollmentStatusPageWindows10.psm1 index dfaf5a6fc4..6dd891fbc7 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceEnrollmentStatusPageWindows10/MSFT_IntuneDeviceEnrollmentStatusPageWindows10.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceEnrollmentStatusPageWindows10/MSFT_IntuneDeviceEnrollmentStatusPageWindows10.psm1 @@ -148,6 +148,12 @@ function Get-TargetResource Write-Verbose -Message "Could not find an Intune Device Enrollment Configuration for Windows10 with DisplayName {$DisplayName}" return $nullResult } + + if($getValue -is [Array]) + { + Throw "The DisplayName {$DisplayName} returned multiple policies, make sure DisplayName is unique." + } + $Id = $getValue.Id Write-Verbose -Message "An Intune Device Enrollment Configuration for Windows10 with Id {$Id} and DisplayName {$DisplayName} was found." @@ -764,17 +770,21 @@ function Update-DeviceEnrollmentConfigurationPriority try { $Uri = "https://graph.microsoft.com/beta/deviceManagement/deviceEnrollmentConfigurations/$DeviceEnrollmentConfigurationId/setpriority" - $body = @{'priority' = $Priority } | ConvertTo-Json -Depth 20 + $body = @{'priority' = $Priority } | ConvertTo-Json -Depth 100 #write-verbose -Message $body - Invoke-MgGraphRequest -Method POST -Uri $Uri -Body $body -ErrorAction Stop 4> Out-Null + Invoke-MgGraphRequest ` + -Method POST ` + -Body $body ` + -Uri $Uri ` + -ErrorAction Stop 4> Out-Null } catch { - New-M365DSCLogEntry -Message 'Error updating data:' - -Exception $_ - -Source $($MyInvocation.MyCommand.Source) - -TenantId $TenantId - -Credential $Credential + New-M365DSCLogEntry -Message 'Error updating data:' ` + -Exception $_ ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential return $null } diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceEnrollmentStatusPageWindows10/MSFT_IntuneDeviceEnrollmentStatusPageWindows10.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceEnrollmentStatusPageWindows10/MSFT_IntuneDeviceEnrollmentStatusPageWindows10.schema.mof index 1e45c0ca83..b4b6ccf761 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceEnrollmentStatusPageWindows10/MSFT_IntuneDeviceEnrollmentStatusPageWindows10.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceEnrollmentStatusPageWindows10/MSFT_IntuneDeviceEnrollmentStatusPageWindows10.schema.mof @@ -13,7 +13,7 @@ class MSFT_DeviceManagementConfigurationPolicyAssignments class MSFT_IntuneDeviceEnrollmentStatusPageWindows10 : OMI_BaseResource { [Key, Description("The display name of the device enrollment configuration")] String DisplayName; - [Required, Description("The unique identifier for an entity. Read-only.")] String Id; + [Write, Description("The unique identifier for an entity. Read-only.")] String Id; [Write, Description("The description of the device enrollment configuration")] String Description; [Write, Description("Allow or block device reset on installation failure")] Boolean AllowDeviceResetOnInstallFailure; [Write, Description("Allow the user to continue using the device on installation failure")] Boolean AllowDeviceUseOnInstallFailure;