Skip to content

Commit 32af0b1

Browse files
committed
fix: InTune Catalog update error
1 parent 52398eb commit 32af0b1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Modules/CIPPCore/Public/Set-CIPPIntunePolicy.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ function Set-CIPPIntunePolicy {
122122
$DisplayName = ($RawJSON | ConvertFrom-Json).Name
123123
$CheckExististing = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/$PlatformType/$TemplateTypeURL" -tenantid $tenantFilter
124124
if ($DisplayName -in $CheckExististing.name) {
125+
$PolicyFile = $RawJSON | ConvertFrom-Json | Select-Object * -ExcludeProperty Platform, PolicyType, CreationSource
126+
$RawJSON = ConvertTo-Json -InputObject $PolicyFile -Depth 100 -Compress
125127
$ExistingID = $CheckExististing | Where-Object -Property Name -EQ $DisplayName
126128
$CreateRequest = New-GraphPOSTRequest -uri "https://graph.microsoft.com/beta/$PlatformType/$TemplateTypeURL/$($ExistingID.Id)" -tenantid $tenantFilter -type PUT -body $RawJSON
127129
$CreateRequest = $CheckExististing | Where-Object -Property Name -EQ $DisplayName

0 commit comments

Comments
 (0)