File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments