Skip to content

Commit 6998c73

Browse files
committed
update variable list
1 parent b332b88 commit 6998c73

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Modules/CIPPCore/Public/Get-CIPPTextReplacement.ps1

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ function Get-CIPPTextReplacement {
1818
if ($Text -isnot [string]) {
1919
return $Text
2020
}
21-
$blacklist = @(
21+
22+
$ReservedVariables = @(
2223
'%serial%',
2324
'%systemroot%',
2425
'%systemdrive%',
@@ -27,8 +28,16 @@ function Get-CIPPTextReplacement {
2728
'%tenantfilter%',
2829
'%tenantname%',
2930
'%partnertenantid%',
30-
'%samappid%'
31+
'%samappid%',
32+
'%userprofile%',
33+
'%username%',
34+
'%userdomain%',
35+
'%windir%',
36+
'%programfiles%',
37+
'%programfiles(x86)%',
38+
'%programdata%'
3139
)
40+
3241
$Tenant = Get-Tenants -TenantFilter $TenantFilter
3342
$CustomerId = $Tenant.customerId
3443

@@ -54,7 +63,7 @@ function Get-CIPPTextReplacement {
5463
# Replace custom variables
5564
foreach ($Replace in $Vars.GetEnumerator()) {
5665
$String = '%{0}%' -f $Replace.Key
57-
if ($string -notin $blacklist) {
66+
if ($string -notin $ReservedVariables) {
5867
$Text = $Text -replace $String, $Replace.Value
5968
}
6069
}

0 commit comments

Comments
 (0)