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

PR: IntuneDeviceEnrollmentStatusPageWindows10 - fixes: 3442 #3878

Merged
merged 3 commits into from
Nov 10, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on @NikCharlebois recommendations #3344 , I've added a throw to prevent processing policies with duplicated names

{
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."

Expand Down Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down