File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ function Set-CIPPIntunePolicy {
7676 $null = $PolicyFile | Add-Member - MemberType NoteProperty - Name ' displayName' - Value $displayname - Force
7777 $RawJSON = ConvertTo-Json - InputObject $PolicyFile - Depth 20
7878 $CheckExististing = New-GraphGETRequest - uri " https://graph.microsoft.com/beta/deviceManagement/$TemplateTypeURL " - tenantid $tenantFilter
79- if ($PolicyName -in $PolicyFile .displayName ) {
79+ if ($PolicyFile .displayName -in $CheckExististing .displayName ) {
8080 $PostType = ' edited'
8181 $ExistingID = $CheckExististing | Where-Object - Property displayName -EQ $PolicyName
8282 $CreateRequest = New-GraphPOSTRequest - uri " https://graph.microsoft.com/beta/deviceManagement/$TemplateTypeURL /$ ( $ExistingID.Id ) " - tenantid $tenantFilter - type PATCH - body $RawJSON
You can’t perform that action at this time.
0 commit comments