Skip to content

Commit

Permalink
Error message
Browse files Browse the repository at this point in the history
  • Loading branch information
pkernevez committed Oct 13, 2023
1 parent b0a07bc commit 699f1c5
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,19 @@ function Export-TargetResource
{
$totalCount = 1
}
if ($totalCount -Eq 0)
{
$Message = "GPA The CSsGroup with ID {$($item.GroupId)} could not be found"
New-M365DSCLogEntry -Message $Message `
-Source $MyInvocation.MyCommand.ModuleName
Write-Error $Message
$groupDisplayName = ""
} else {
$groupDisplayName = $Group[0].DisplayName
}
Write-Host " |---[$j/$totalCount] GroupPolicyAssignment {$($Group[0].DisplayName)}" -NoNewline
$results = @{
GroupDisplayName = $Group[0].DisplayName
GroupDisplayName = $groupDisplayName
GroupId = $item.GroupId
PolicyType = $item.PolicyType
PolicyName = $item.PolicyName
Expand Down

0 comments on commit 699f1c5

Please sign in to comment.