Skip to content

Commit 957aefc

Browse files
authored
Merge pull request KelvinTegelaar#1052 from JohnDuprey/dev
Bugfixes
2 parents 9090d49 + 24a2d29 commit 957aefc

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-ExecStandardsRun.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Function Invoke-ExecStandardsRun {
1313
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug'
1414
$tenantfilter = if ($Request.Query.TenantFilter) { $Request.Query.TenantFilter } else { 'allTenants' }
1515
try {
16-
$null = Invoke-CIPPStandardsRun -Tenantfilter $tenantfilter
16+
$null = Invoke-CIPPStandardsRun -Tenantfilter $tenantfilter -Force
1717
$Results = "Successfully Started Standards Run for Tenant $tenantfilter"
1818
} catch {
1919
$Results = "Failed to start standards run for $tenantfilter. Error: $($_.Exception.Message)"

Modules/CIPPCore/Public/Invoke-CIPPStandardsRun.ps1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,20 @@ function Invoke-CIPPStandardsRun {
33
[CmdletBinding()]
44
param(
55
[Parameter(Mandatory = $false)]
6-
[string]$TenantFilter = 'allTenants'
6+
[string]$TenantFilter = 'allTenants',
7+
[switch]$Force
78
)
89
Write-Host "Starting process for standards - $($tenantFilter)"
910

1011
$AllTasks = Get-CIPPStandards -TenantFilter $TenantFilter
1112

13+
if ($Force.IsPresent) {
14+
Write-Host 'Clearing Rerun Cache'
15+
foreach ($Task in $AllTasks) {
16+
$null = Test-CIPPRerun -Type Standard -Tenant $Task.Tenant -Settings @{} -API $Task.Standard
17+
}
18+
}
19+
1220
#For each item in our object, run the queue.
1321
$Queue = New-CippQueueEntry -Name "Applying Standards ($TenantFilter)" -TotalTasks ($AllTasks | Measure-Object).Count
1422

@@ -26,4 +34,4 @@ function Invoke-CIPPStandardsRun {
2634
$InstanceId = Start-NewOrchestration -FunctionName 'CIPPOrchestrator' -InputObject ($InputObject | ConvertTo-Json -Depth 5 -Compress)
2735
Write-Host "Started orchestration with ID = '$InstanceId'"
2836
#$Orchestrator = New-OrchestrationCheckStatusResponse -Request $Request -InstanceId $InstanceId
29-
}
37+
}

Modules/CippExtensions/Public/Hudu/Invoke-HuduExtensionSync.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,9 @@ function Invoke-HuduExtensionSync {
772772
$HuduDevice = $HuduDevices | Where-Object { $_.name -eq $device.deviceName -or ($_.cards.integrator_name -eq 'cw_manage' -and $_.cards.data.name -contains $device.deviceName) }
773773
} else {
774774
$HuduDevice = $HuduDevices | Where-Object { $_.primary_serial -eq $device.serialNumber -or ($_.cards.integrator_name -eq 'cw_manage' -and $_.cards.data.serialNumber -eq $device.serialNumber) }
775+
if (!$HuduDevice) {
776+
$HuduDevice = $HuduDevices | Where-Object { $_.name -eq $device.deviceName -or ($_.cards.integrator_name -eq 'cw_manage' -and $_.cards.data.name -contains $device.deviceName) }
777+
}
775778
}
776779

777780
[System.Collections.Generic.List[PSCustomObject]]$DeviceLinksFormatted = @()

0 commit comments

Comments
 (0)