Skip to content

Commit 48e15d5

Browse files
committed
Update Invoke-CIPPStandardIntuneTemplate.ps1
1 parent d2f28eb commit 48e15d5

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardIntuneTemplate.ps1

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,7 @@ function Invoke-CIPPStandardIntuneTemplate {
4949
$RawJSON = $Request.body.RawJSON
5050
$ExistingPolicy = Get-CIPPIntunePolicy -tenantFilter $Tenant -DisplayName $displayname -TemplateType $Request.body.Type
5151
if ($ExistingPolicy) {
52-
$ReplaceTable = Get-CIPPTable -tablename 'CippReplacemap'
53-
$ReplaceMap = Get-CIPPAzDataTableEntity @ReplaceTable -Filter "PartitionKey eq '$tenant'"
54-
if ($ReplaceMap) {
55-
foreach ($Replace in $ReplaceMap) {
56-
$String = '%{0}%' -f $Replace.RowKey
57-
$RawJSON = $RawJSON -replace $String, $Replace.Value
58-
}
59-
}
60-
$RawJSON = $RawJSON -replace '%tenantid%', $TenantList.customerId
61-
$RawJSON = $RawJSON -replace '%tenantfilter%', $TenantLists.defaultDomainName
62-
$RawJSON = $RawJSON -replace '%tenantname%', $TenantList.displayName
52+
$RawJSON = Get-CIPPTextReplacement -Text $RawJSON -TenantFilter $Tenant
6353

6454
$JSONExistingPolicy = $ExistingPolicy.cippconfiguration | ConvertFrom-Json
6555
$JSONTemplate = $RawJSON | ConvertFrom-Json

0 commit comments

Comments
 (0)