The code relies on a try/catch when looking for the provided approvers to detect when the approver does not exist. However when using the filter parameter of Get-MgUser/Get-MgGroup, an exception is never thrown.
This code has to be changed to check for $null instead.
Description of the issue
The code relies on a try/catch when looking for the provided approvers to detect when the approver does not exist. However when using the filter parameter of Get-MgUser/Get-MgGroup, an exception is never thrown.
This code has to be changed to check for $null instead.
Microsoft 365 DSC Version
Dev
Which workloads are affected
Azure Active Directory (Entra ID)
The DSC configuration
Verbose logs showing the problem
Environment Information + PowerShell Version