Skip to content

Commit 1b8c0c1

Browse files
committed
Fixes for CA template editing dropping the package tag
1 parent d358ae5 commit 1b8c0c1

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ExecEditTemplate.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function Invoke-ExecEditTemplate {
1212
try {
1313
$Table = Get-CippTable -tablename 'templates'
1414
$guid = $request.Body.id ? $request.Body.id : $request.Body.GUID
15-
$JSON = ConvertTo-Json -Compress -Depth 100 -InputObject ($request.Body | Select-Object * -ExcludeProperty GUID)
15+
$JSON = ConvertTo-Json -Compress -Depth 100 -InputObject ($request.Body | Select-Object * -ExcludeProperty GUID, source, isSynced, package)
1616
$Type = $request.Query.Type ?? $Request.Body.Type
1717

1818
if ($Type -eq 'IntuneTemplate') {
@@ -63,13 +63,14 @@ function Invoke-ExecEditTemplate {
6363
}
6464
Set-CIPPIntuneTemplate @IntuneTemplate
6565
} else {
66-
$Table.Force = $true
67-
Add-CIPPAzDataTableEntity @Table -Entity @{
66+
$Entity = @{
6867
JSON = "$JSON"
6968
RowKey = "$GUID"
7069
PartitionKey = "$Type"
7170
GUID = "$GUID"
71+
SHA = ''
7272
}
73+
Add-CIPPAzDataTableEntity @Table -Entity $Entity -OperationType 'UpsertMerge'
7374
Write-LogMessage -headers $Request.Headers -API $APINAME -message "Edited template $($Request.Body.name) with GUID $GUID" -Sev 'Debug'
7475
}
7576
$body = [pscustomobject]@{ 'Results' = 'Successfully saved the template' }

0 commit comments

Comments
 (0)