Skip to content

Commit 54a5441

Browse files
committed
fix: update tenant retrieval logic to handle cases where TenantFilter matches the environment TenantID
1 parent 074a969 commit 54a5441

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Modules/CIPPCore/Public/Get-CIPPTextReplacement.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ function Get-CIPPTextReplacement {
4444
'%organizationid%'
4545
)
4646

47-
$Tenant = Get-Tenants -TenantFilter $TenantFilter
48-
$CustomerId = $Tenant.customerId
47+
if ($TenantFilter -ne $env:TenantID) {
48+
$Tenant = Get-Tenants -TenantFilter $TenantFilter
49+
$CustomerId = $Tenant.customerId
50+
} else {
51+
$CustomerId = $TenantFilter
52+
}
4953

5054
#connect to table, get replacement map. The replacement map will allow users to create custom vars that get replaced by the actual values per tenant. Example:
5155
# %WallPaperPath% gets replaced by RowKey WallPaperPath which is set to C:\Wallpapers for tenant 1, and D:\Wallpapers for tenant 2

0 commit comments

Comments
 (0)