Skip to content

Commit 72aba48

Browse files
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into dev
2 parents 846df85 + 60fea48 commit 72aba48

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Modules/CIPPCore/Public/Get-CIPPTextReplacement.ps1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ function Get-CIPPTextReplacement {
3737
'%programfiles%',
3838
'%programfiles(x86)%',
3939
'%programdata%',
40-
'%cippuserschema%'
40+
'%cippuserschema%',
41+
'%cippurl%',
42+
'%defaultdomain%'
4143
)
4244

4345
$Tenant = Get-Tenants -TenantFilter $TenantFilter
@@ -72,6 +74,7 @@ function Get-CIPPTextReplacement {
7274
#default replacements for all tenants: %tenantid% becomes $tenant.customerId, %tenantfilter% becomes $tenant.defaultDomainName, %tenantname% becomes $tenant.displayName
7375
$Text = $Text -replace '%tenantid%', $Tenant.customerId
7476
$Text = $Text -replace '%tenantfilter%', $Tenant.defaultDomainName
77+
$Text = $Text -replace '%defaultdomain%', $Tenant.defaultDomainName
7578
$Text = $Text -replace '%initialdomain%', $Tenant.initialDomainName
7679
$Text = $Text -replace '%tenantname%', $Tenant.displayName
7780

@@ -83,5 +86,13 @@ function Get-CIPPTextReplacement {
8386
$Schema = Get-CIPPSchemaExtensions | Where-Object { $_.id -match '_cippUser' } | Select-Object -First 1
8487
$Text = $Text -replace '%cippuserschema%', $Schema.id
8588
}
89+
90+
if ($Text -match '%cippurl%') {
91+
$ConfigTable = Get-CIPPTable -tablename 'Config'
92+
$Config = Get-CIPPAzDataTableEntity @ConfigTable -Filter "PartitionKey eq 'InstanceProperties' and RowKey eq 'CIPPURL'"
93+
if ($Config) {
94+
$Text = $Text -replace '%cippurl%', $Config.Value
95+
}
96+
}
8697
return $Text
8798
}

0 commit comments

Comments
 (0)