File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments