Skip to content

Commit cd99cf1

Browse files
committed
limit sync to policies/templates with SHA
1 parent 9e02376 commit cd99cf1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Endpoint/MEM/Invoke-ListIntuneTemplates.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function Invoke-ListIntuneTemplates {
3939
$data | Add-Member -NotePropertyName 'Type' -NotePropertyValue $JSONData.Type -Force
4040
$data | Add-Member -NotePropertyName 'GUID' -NotePropertyValue $_.RowKey -Force
4141
$data | Add-Member -NotePropertyName 'package' -NotePropertyValue $_.Package -Force
42+
$data | Add-Member -NotePropertyName 'isSynced' -NotePropertyValue (![string]::IsNullOrEmpty($_.SHA))
4243
$data
4344
} catch {
4445

Modules/CIPPCore/Public/New-CIPPTemplateRun.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function New-CIPPTemplateRun {
4141
}
4242
foreach ($File in $Files) {
4343
if ($File.name -eq 'MigrationTable' -or $file.name -eq 'ALLOWED COUNTRIES') { continue }
44-
$ExistingTemplate = $ExistingTemplates | Where-Object { (![string]::IsNullOrEmpty($_.displayName) -and (Get-SanitizedFilename -filename $_.displayName) -eq $File.name) -or (![string]::IsNullOrEmpty($_.templateName) -and (Get-SanitizedFilename -filename $_.templateName) -eq $File.name ) } | Select-Object -First 1
44+
$ExistingTemplate = $ExistingTemplates | Where-Object { (![string]::IsNullOrEmpty($_.displayName) -and (Get-SanitizedFilename -filename $_.displayName) -eq $File.name) -or (![string]::IsNullOrEmpty($_.templateName) -and (Get-SanitizedFilename -filename $_.templateName) -eq $File.name ) -and ![string]::IsNullOrEmpty($_.SHA) } | Select-Object -First 1
4545

4646
$UpdateNeeded = $false
4747
if ($ExistingTemplate -and $ExistingTemplate.SHA -ne $File.sha) {

0 commit comments

Comments
 (0)