Skip to content

Commit

Permalink
Merge pull request KelvinTegelaar#1052 from JohnDuprey/dev
Browse files Browse the repository at this point in the history
Bugfixes
  • Loading branch information
JohnDuprey authored Aug 9, 2024
2 parents 9090d49 + 24a2d29 commit 957aefc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Function Invoke-ExecStandardsRun {
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug'
$tenantfilter = if ($Request.Query.TenantFilter) { $Request.Query.TenantFilter } else { 'allTenants' }
try {
$null = Invoke-CIPPStandardsRun -Tenantfilter $tenantfilter
$null = Invoke-CIPPStandardsRun -Tenantfilter $tenantfilter -Force
$Results = "Successfully Started Standards Run for Tenant $tenantfilter"
} catch {
$Results = "Failed to start standards run for $tenantfilter. Error: $($_.Exception.Message)"
Expand Down
12 changes: 10 additions & 2 deletions Modules/CIPPCore/Public/Invoke-CIPPStandardsRun.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ function Invoke-CIPPStandardsRun {
[CmdletBinding()]
param(
[Parameter(Mandatory = $false)]
[string]$TenantFilter = 'allTenants'
[string]$TenantFilter = 'allTenants',
[switch]$Force
)
Write-Host "Starting process for standards - $($tenantFilter)"

$AllTasks = Get-CIPPStandards -TenantFilter $TenantFilter

if ($Force.IsPresent) {
Write-Host 'Clearing Rerun Cache'
foreach ($Task in $AllTasks) {
$null = Test-CIPPRerun -Type Standard -Tenant $Task.Tenant -Settings @{} -API $Task.Standard
}
}

#For each item in our object, run the queue.
$Queue = New-CippQueueEntry -Name "Applying Standards ($TenantFilter)" -TotalTasks ($AllTasks | Measure-Object).Count

Expand All @@ -26,4 +34,4 @@ function Invoke-CIPPStandardsRun {
$InstanceId = Start-NewOrchestration -FunctionName 'CIPPOrchestrator' -InputObject ($InputObject | ConvertTo-Json -Depth 5 -Compress)
Write-Host "Started orchestration with ID = '$InstanceId'"
#$Orchestrator = New-OrchestrationCheckStatusResponse -Request $Request -InstanceId $InstanceId
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,9 @@ function Invoke-HuduExtensionSync {
$HuduDevice = $HuduDevices | Where-Object { $_.name -eq $device.deviceName -or ($_.cards.integrator_name -eq 'cw_manage' -and $_.cards.data.name -contains $device.deviceName) }
} else {
$HuduDevice = $HuduDevices | Where-Object { $_.primary_serial -eq $device.serialNumber -or ($_.cards.integrator_name -eq 'cw_manage' -and $_.cards.data.serialNumber -eq $device.serialNumber) }
if (!$HuduDevice) {
$HuduDevice = $HuduDevices | Where-Object { $_.name -eq $device.deviceName -or ($_.cards.integrator_name -eq 'cw_manage' -and $_.cards.data.name -contains $device.deviceName) }
}
}

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

0 comments on commit 957aefc

Please sign in to comment.