From 0d1e89963202639f25ca613e709fe8cc8395b270 Mon Sep 17 00:00:00 2001 From: mspreeuwenberg <76214805+mspreeuwenberg@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:47:47 +0100 Subject: [PATCH] fix: no error on employee not found (#17) --- delete.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/delete.ps1 b/delete.ps1 index 886eb54..0d2fa4d 100644 --- a/delete.ps1 +++ b/delete.ps1 @@ -203,7 +203,7 @@ try { Write-Verbose "Error at Line [$($ex.InvocationInfo.ScriptLineNumber)]: $($ex.InvocationInfo.Line). Error: $($errorMessage.VerboseErrorMessage)" - if ($errorMessage.AuditErrorMessage -Like "No AFAS employee found AFAS employee where [$($correlationProperty)] = [$($correlationValue)]") { + if ($errorMessage.AuditErrorMessage -Like "No AFAS employee found AFAS employee*") { $outputContext.AuditLogs.Add([PSCustomObject]@{ Action = "DeleteAccount" Message = "No AFAS employee found AFAS employee where [$($correlationProperty)] = [$($correlationValue)]. Possibly deleted."