@@ -61,12 +61,21 @@ function Get-CIPPStandards {
61
61
$CurrentStandard | Add-Member - NotePropertyName ' TemplateId' - NotePropertyValue $Template.GUID - Force
62
62
63
63
if ($CurrentStandard.action.value -contains ' Remediate' -and -not ($CurrentStandard.action.value -contains ' Report' )) {
64
+ Write-Host ' STRDS: autoRemediate set to true, adding Remediate action'
65
+
64
66
$reportAction = [pscustomobject ]@ {
65
67
label = ' Report'
66
68
value = ' Report'
67
69
}
68
70
$CurrentStandard.action = @ ($CurrentStandard.action ) + $reportAction
69
71
}
72
+ # If its a drift template, with autoRemediate, we add the Remediate action.
73
+ if ($CurrentStandard.autoRemediate -eq $true ) {
74
+ $CurrentStandard.action = @ ($CurrentStandard.action ) + [pscustomobject ]@ {
75
+ label = ' Remediate'
76
+ value = ' Remediate'
77
+ }
78
+ }
70
79
71
80
$Actions = $CurrentStandard.action.value
72
81
if ($Actions -contains ' Remediate' -or $Actions -contains ' warn' -or $Actions -contains ' Report' ) {
@@ -90,6 +99,14 @@ function Get-CIPPStandards {
90
99
}
91
100
$CurrentStandard.action = @ ($CurrentStandard.action ) + $reportAction
92
101
}
102
+ # If its a drift template, with autoRemediate, we add the Remediate action.
103
+ if ($CurrentStandard.autoRemediate -eq $true ) {
104
+ Write-Host ' STRDS: autoRemediate set to true, adding Remediate action'
105
+ $CurrentStandard.action = @ ($CurrentStandard.action ) + [pscustomobject ]@ {
106
+ label = ' Remediate'
107
+ value = ' Remediate'
108
+ }
109
+ }
93
110
94
111
$Actions = $CurrentStandard.action.value
95
112
if ($Actions -contains ' Remediate' -or $Actions -contains ' warn' -or $Actions -contains ' Report' ) {
@@ -235,6 +252,14 @@ function Get-CIPPStandards {
235
252
}
236
253
$CurrentStandard.action = @ ($CurrentStandard.action ) + $reportAction
237
254
}
255
+ # If its a drift template, with autoRemediate, we add the Remediate action.
256
+ if ($CurrentStandard.autoRemediate -eq $true ) {
257
+ Write-Host ' STRDS: autoRemediate set to true, adding Remediate action'
258
+ $CurrentStandard.action = @ ($CurrentStandard.action ) + [pscustomobject ]@ {
259
+ label = ' Remediate'
260
+ value = ' Remediate'
261
+ }
262
+ }
238
263
239
264
$Actions = $CurrentStandard.action.value
240
265
if ($Actions -contains ' Remediate' -or $Actions -contains ' warn' -or $Actions -contains ' Report' ) {
@@ -269,6 +294,14 @@ function Get-CIPPStandards {
269
294
}
270
295
$CurrentStandard.action = @ ($CurrentStandard.action ) + $reportAction
271
296
}
297
+ # If its a drift template, with autoRemediate, we add the Remediate action.
298
+ if ($CurrentStandard.autoRemediate -eq $true ) {
299
+ Write-Host ' STRDS: autoRemediate set to true, adding Remediate action'
300
+ $CurrentStandard.action = @ ($CurrentStandard.action ) + [pscustomobject ]@ {
301
+ label = ' Remediate'
302
+ value = ' Remediate'
303
+ }
304
+ }
272
305
273
306
# Filter actions only 'Remediate','warn','Report'
274
307
$Actions = $CurrentStandard.action.value | Where-Object { $_ -in ' Remediate' , ' warn' , ' Report' }
@@ -292,6 +325,14 @@ function Get-CIPPStandards {
292
325
}
293
326
$CurrentStandard.action = @ ($CurrentStandard.action ) + $reportAction
294
327
}
328
+ # If its a drift template, with autoRemediate, we add the Remediate action.
329
+ if ($CurrentStandard.autoRemediate -eq $true ) {
330
+ Write-Host ' STRDS: autoRemediate set to true, adding Remediate action'
331
+ $CurrentStandard.action = @ ($CurrentStandard.action ) + [pscustomobject ]@ {
332
+ label = ' Remediate'
333
+ value = ' Remediate'
334
+ }
335
+ }
295
336
296
337
$Actions = $CurrentStandard.action.value | Where-Object { $_ -in ' Remediate' , ' warn' , ' Report' }
297
338
if ($Actions -contains ' Remediate' -or $Actions -contains ' warn' -or $Actions -contains ' Report' ) {
0 commit comments