Skip to content

Commit 64cd240

Browse files
committed
Update Set-CIPPSPOTenant.ps1
1 parent b323911 commit 64cd240

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Modules/CIPPCore/Public/Set-CIPPSPOTenant.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,14 @@ function Set-CIPPSPOTenant {
5757
# Get property type
5858
$PropertyType = $Properties[$Property].GetType().Name
5959
if ($PropertyType -in $AllowedTypes) {
60-
if ($PropertyType -eq 'Boolean') { $Properties[$Property] = $Properties[$Property].ToString().ToLower() }
60+
if ($PropertyType -eq 'Boolean') {
61+
$PropertyToSet = $Properties[$Property].ToString().ToLower()
62+
} else {
63+
$PropertyToSet = $Properties[$Property]
64+
}
6165
$xml = @"
6266
<SetProperty Id="$x" ObjectPathId="110" Name="$Property">
63-
<Parameter Type="Boolean">$($Properties[$Property])</Parameter>
67+
<Parameter Type="Boolean">$($PropertyToSet)</Parameter>
6468
</SetProperty>
6569
"@
6670
$SetProperty.Add($xml)
@@ -85,4 +89,4 @@ function Set-CIPPSPOTenant {
8589
New-GraphPostRequest -scope "$AdminURL/.default" -tenantid $TenantFilter -Uri "$AdminURL/_vti_bin/client.svc/ProcessQuery" -Type POST -Body $XML -ContentType 'text/xml' -AddedHeaders $AdditionalHeaders
8690
}
8791
}
88-
}
92+
}

0 commit comments

Comments
 (0)