diff --git a/Modules/CIPPCore/Public/Entrypoints/Invoke-AddStandardsDeploy.ps1 b/Modules/CIPPCore/Public/Entrypoints/Invoke-AddStandardsDeploy.ps1 index 30a4c2c04fb4..06fd14877704 100644 --- a/Modules/CIPPCore/Public/Entrypoints/Invoke-AddStandardsDeploy.ps1 +++ b/Modules/CIPPCore/Public/Entrypoints/Invoke-AddStandardsDeploy.ps1 @@ -16,7 +16,7 @@ Function Invoke-AddStandardsDeploy { try { $Tenants = ($Request.body | Select-Object Select_*).psobject.properties.value - $Settings = ($request.body | Select-Object -Property *, 'v2' -ExcludeProperty Select_*, None ) + $Settings = ($request.body | Select-Object -Property *, v2* -ExcludeProperty Select_*, None ) $Settings.v2 = $true foreach ($Tenant in $tenants) { @@ -37,8 +37,7 @@ Function Invoke-AddStandardsDeploy { } Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Successfully added standards deployment' -Sev 'Info' $body = [pscustomobject]@{'Results' = 'Successfully added standards deployment' } - } - catch { + } catch { Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message "Standards API failed. Error:$($_.Exception.Message)" -Sev 'Error' $body = [pscustomobject]@{'Results' = "Failed to add standard: $($_.Exception.Message)" } } diff --git a/Modules/CIPPCore/Public/Invoke-CIPPStandardsRun.ps1 b/Modules/CIPPCore/Public/Invoke-CIPPStandardsRun.ps1 index 6c9e0949a70e..d6a1ff13fe58 100644 --- a/Modules/CIPPCore/Public/Invoke-CIPPStandardsRun.ps1 +++ b/Modules/CIPPCore/Public/Invoke-CIPPStandardsRun.ps1 @@ -78,7 +78,7 @@ function Invoke-CIPPStandardsRun { #For each item in our object, run the queue. - foreach ($task in $object | Where-Object -Property Standard -NE 'v2') { + foreach ($task in $object | Where-Object -Property Standard -NotLike 'v2*') { $QueueItem = [pscustomobject]@{ Tenant = $task.Tenant Standard = $task.Standard