Skip to content

Commit 6e4d78c

Browse files
authored
Merge pull request #581 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 581d163 + 65500f0 commit 6e4d78c

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Standards/Push-CIPPDriftManagement.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function Push-CippDriftManagement {
1212
try {
1313
$Drift = Get-CIPPDrift -TenantFilter $Item.Tenant
1414
if ($Drift.newDeviationsCount -gt 0) {
15-
$Settings = (Get-CIPPTenantAlignment -TenantFilter $Item.Tenant | Where-Object -Property standardType -EQ 'drift')
15+
$Settings = $Drift.driftSettings
1616
$email = $Settings.driftAlertEmail
1717
$webhook = $Settings.driftAlertWebhook
1818
$CippConfigTable = Get-CippTable -tablename Config

Modules/CIPPCore/Public/Get-CIPPDrift.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ function Get-CIPPDrift {
3535
$RawIntuneTemplates = (Get-CIPPAzDataTableEntity @IntuneTable -Filter $IntuneFilter)
3636
$AllIntuneTemplates = $RawIntuneTemplates | ForEach-Object {
3737
try {
38-
$JSONData = $_.JSON | ConvertFrom-Json -Depth 100 -ErrorAction SilentlyContinue
39-
$data = $JSONData.RAWJson | ConvertFrom-Json -Depth 100 -ErrorAction SilentlyContinue
38+
$JSONData = $_.JSON | ConvertFrom-Json -Depth 10 -ErrorAction SilentlyContinue
39+
$data = $JSONData.RAWJson | ConvertFrom-Json -Depth 10 -ErrorAction SilentlyContinue
4040
$data | Add-Member -NotePropertyName 'displayName' -NotePropertyValue $JSONData.Displayname -Force
4141
$data | Add-Member -NotePropertyName 'description' -NotePropertyValue $JSONData.Description -Force
4242
$data | Add-Member -NotePropertyName 'Type' -NotePropertyValue $JSONData.Type -Force
@@ -277,7 +277,7 @@ function Get-CIPPDrift {
277277
standardName = $PolicyKey
278278
standardDisplayName = "Intune - $TenantPolicyName"
279279
expectedValue = 'This policy only exists in the tenant, not in the template.'
280-
receivedValue = ($TenantPolicy.Policy | ConvertTo-Json -Depth 10 -Compress)
280+
receivedValue = $TenantPolicy.Policy
281281
state = 'current'
282282
Status = $Status
283283
}
@@ -307,7 +307,7 @@ function Get-CIPPDrift {
307307
standardName = $PolicyKey
308308
standardDisplayName = "Conditional Access - $($TenantCAPolicy.displayName)"
309309
expectedValue = 'This policy only exists in the tenant, not in the template.'
310-
receivedValue = ($TenantCAPolicy | ConvertTo-Json -Depth 10 -Compress)
310+
receivedValue = $TenantCAPolicy
311311
state = 'current'
312312
Status = $Status
313313
}
@@ -347,6 +347,7 @@ function Get-CIPPDrift {
347347
deniedDeviations = @($DeniedDeviations)
348348
allDeviations = @($AllDeviations)
349349
latestDataCollection = $Alignment.LatestDataCollection
350+
driftSettings = $AlignmentData
350351
}
351352

352353
$Results.Add($Result)

Modules/CIPPCore/Public/GraphHelper/New-GraphGetRequest.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function New-GraphGetRequest {
152152
# Check for "Resource temporarily unavailable"
153153
elseif ($Message -like '*Resource temporarily unavailable*') {
154154
if ($RetryCount -lt $MaxRetries) {
155-
$WaitTime = Get-Random -Minimum 1 -Maximum 10 # Random sleep between 1-10 seconds
155+
$WaitTime = Get-Random -Minimum 1.1 -Maximum 3.1 # Random sleep between 1-2 seconds
156156
Write-Warning "Resource temporarily unavailable. Waiting $WaitTime seconds before retry. Attempt $($RetryCount + 1) of $MaxRetries"
157157
$ShouldRetry = $true
158158
}

Modules/CippExtensions/Public/NinjaOne/Invoke-NinjaOneTenantSync.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,7 @@ function Invoke-NinjaOneTenantSync {
18521852
$StandardsDefinitions = Invoke-RestMethod -Uri 'https://raw.githubusercontent.com/KelvinTegelaar/CIPP/refs/heads/main/src/data/standards.json'
18531853
$AppliedStandards = Get-CIPPStandards -TenantFilter $Customer.defaultDomainName
18541854
$Templates = Get-CIPPTable 'templates'
1855-
$StandardTemplates = Get-CIPPAzDataTableEntity @Templates | Where-Object { $_.PartitionKey -eq 'StandardsTemplateV2' }
1855+
$StandardTemplates = Get-CIPPAzDataTableEntity @Templates -Filter "PartitionKey eq 'StandardsTemplateV2'"
18561856

18571857
$ParsedStandards = foreach ($Standard in $AppliedStandards) {
18581858
Write-Information "Processing Standard: $($Standard | ConvertTo-Json -Depth 10)"

0 commit comments

Comments
 (0)