From 8e43edf09ca6402a21f9739aaeda4e80c09f2122 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Mon, 11 Dec 2023 15:51:18 +0100 Subject: [PATCH 1/2] Hotfix --- Modules/CIPPCore/Public/Invoke-CIPPStandardsRun.ps1 | 11 ++++++++--- version_latest.txt | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Modules/CIPPCore/Public/Invoke-CIPPStandardsRun.ps1 b/Modules/CIPPCore/Public/Invoke-CIPPStandardsRun.ps1 index ee6b6939a823..6c9e0949a70e 100644 --- a/Modules/CIPPCore/Public/Invoke-CIPPStandardsRun.ps1 +++ b/Modules/CIPPCore/Public/Invoke-CIPPStandardsRun.ps1 @@ -16,7 +16,7 @@ function Invoke-CIPPStandardsRun { $Tenants = (Get-CIPPAzDataTableEntity @Table -Filter $Filter).JSON | ConvertFrom-Json #Migrate from old standards to new standards. - $Tenants | Where-Object -Property 'v2' -NE $true | ForEach-Object { + $Tenants | Where-Object -Property 'v2.1' -NE $true | ForEach-Object { $OldStd = $_ $OldStd.standards.psobject.properties.name | ForEach-Object { if ($_ -eq 'MailContacts') { @@ -28,10 +28,15 @@ function Invoke-CIPPStandardsRun { remediate = $true } } else { - $OldStd.Standards.$_ | Add-Member -NotePropertyName 'remediate' -NotePropertyValue $true + if ($OldStd.Standards.$_ -eq $true) { + $OldStd.Standards.$_ = @{ remediate = $true } + } else { + $OldStd.Standards.$_ | Add-Member -NotePropertyName 'remediate' -NotePropertyValue $true -Force + } + } } - $OldStd | Add-Member -NotePropertyName 'v2' -NotePropertyValue $true -PassThru -Force + $OldStd | Add-Member -NotePropertyName 'v2.1' -NotePropertyValue $true -PassThru -Force $Entity = @{ PartitionKey = 'standards' RowKey = "$($OldStd.Tenant)" diff --git a/version_latest.txt b/version_latest.txt index 6ca6df113f09..2871567308a5 100644 --- a/version_latest.txt +++ b/version_latest.txt @@ -1 +1 @@ -4.8.0 \ No newline at end of file +4.8.1 \ No newline at end of file From df423799072b73e0cc8130bf7f3548140e40fbf3 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Mon, 11 Dec 2023 15:52:15 +0100 Subject: [PATCH 2/2] updated settings --- .../Public/Entrypoints/Invoke-AddStandardsDeploy.ps1 | 5 ++--- Modules/CIPPCore/Public/Invoke-CIPPStandardsRun.ps1 | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) 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