Skip to content

Commit 2c5679e

Browse files
authored
Merge pull request KelvinTegelaar#1563 from kris6673/fix-input-validation-cloud-message-recall
Fix: Fix state and input validation logging for CloudMessageRecall
2 parents e7baa77 + 2dfa809 commit 2c5679e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardCloudMessageRecall.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function Invoke-CIPPStandardCloudMessageRecall {
3838
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'CloudMessageRecall'
3939

4040
# Get state value using null-coalescing operator
41-
$state = $Settings.state.value
41+
$state = $Settings.state.value ?? $Settings.state
4242

4343
$CurrentState = (New-ExoRequest -tenantid $Tenant -cmdlet 'Get-OrganizationConfig').MessageRecallEnabled
4444
$WantedState = if ($state -eq 'true') { $true } else { $false }
@@ -53,7 +53,7 @@ function Invoke-CIPPStandardCloudMessageRecall {
5353

5454
# Input validation
5555
if (([string]::IsNullOrWhiteSpace($state) -or $state -eq 'Select a value') -and ($Settings.remediate -eq $true -or $Settings.alert -eq $true)) {
56-
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'MessageRecallEnabled: Invalid state parameter set' -sev Error
56+
Write-LogMessage -API 'Standards' -tenant $Tenant -message 'CloudMessageRecall: Invalid state parameter set' -sev Error
5757
return
5858
}
5959

0 commit comments

Comments
 (0)