File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -117,9 +117,9 @@ function New-CIPPCAPolicy {
117117 }
118118 }
119119
120-
121120 # for each of the locations, check if they exist, if not create them. These are in $jsonobj.LocationInfo
122121 $LocationLookupTable = foreach ($locations in $jsonobj.LocationInfo ) {
122+ if (! $locations ) { continue }
123123 foreach ($location in $locations ) {
124124 if (! $location.displayName ) { continue }
125125 $CheckExististing = New-GraphGETRequest - uri ' https://graph.microsoft.com/beta/identity/conditionalAccess/namedLocations' - tenantid $TenantFilter - asApp $true
@@ -233,7 +233,7 @@ function New-CIPPCAPolicy {
233233 $CheckExististing = New-GraphGETRequest - uri ' https://graph.microsoft.com/beta/identity/conditionalAccess/policies' - tenantid $TenantFilter - asApp $true | Where-Object - Property displayName -EQ $displayname
234234 if ($CheckExististing ) {
235235 if ($Overwrite -ne $true ) {
236- Throw " Conditional Access Policy with Display Name $ ( $Displayname ) Already exists"
236+ throw " Conditional Access Policy with Display Name $ ( $Displayname ) Already exists"
237237 return $false
238238 } else {
239239 Write-Information " overwriting $ ( $CheckExististing.id ) "
You can’t perform that action at this time.
0 commit comments