From 7c73b191f685168d5950e446b246788b2306f3db Mon Sep 17 00:00:00 2001 From: Fabien Tschanz Date: Sat, 15 Jun 2024 13:22:50 +0200 Subject: [PATCH] Allow null as parameter when converting Intune assignments --- Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 index 2b5c3f7ae4..647b6e5b44 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 @@ -1200,12 +1200,18 @@ function ConvertTo-IntunePolicyAssignment [OutputType([Hashtable[]])] param ( [Parameter(Mandatory = $true)] + [AllowNull()] $Assignments, [Parameter()] [System.Boolean] $IncludeDeviceFilter = $true ) + if ($null -eq $Assignments) + { + return ,@() + } + $assignmentResult = @() foreach ($assignment in $Assignments) {