You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ($Result.status-lt200-or$Result.status-gt299) {
97
-
$FailedUsername=$Users|Where-Object { $_.body.id-eq$Result.id } |Select-Object-ExpandProperty body |Select-Object-ExpandProperty userPrincipalName
98
-
Write-LogMessage-headers $Headers-API $APIName-tenant $TenantFilter-message "Failed to add member $($FailedUsername): $($Result.body.error.message)"-Sev 'Error'
111
+
# Select-Object -First 1: Get-NormalizedError can return multiple strings
112
+
# when a message matches more than one of its translation patterns.
113
+
$ErrorText=Get-NormalizedError-message ($Result.body.error.message??"Request failed with status $($Result.status)") |Select-Object-First 1
114
+
Write-LogMessage-headers $Headers-API $APIName-tenant $TenantFilter-message "Failed to add member $UserPrincipalName to group $($GroupName): $ErrorText"-Sev 'Error'
if ($Result.status-lt200-or$Result.status-gt299) {
125
+
# Select-Object -First 1: Get-NormalizedError can return multiple strings
126
+
# when a message matches more than one of its translation patterns.
127
+
$ErrorText=Get-NormalizedError-message ($Result.body.error.message??"Request failed with status $($Result.status)") |Select-Object-First 1
128
+
Write-LogMessage-headers $Headers-API $APIName-tenant $TenantFilter-message "Failed to remove member $UserPrincipalName from group $($GroupName): $ErrorText"-Sev 'Error'
0 commit comments