File tree Expand file tree Collapse file tree
Entrypoints/HTTP Functions/Tenant/Standards Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) "
Original file line number Diff line number Diff 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+ }
You can’t perform that action at this time.
0 commit comments