Skip to content

Commit

Permalink
changed to Write-Error per suggestion.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevio54 committed Jul 23, 2020
1 parent 53bd832 commit c6c50a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Functions/Public/Connect-vRAServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@
if ($_.Exception.Response.StatusCode -eq "BadRequest") {
# This could be due to an incorrectly set UserAttribute, so customizing the message.
if ($Username -match "@") {
Write-Host -ForegroundColor White -BackgroundColor DarkGray "Unfortunately, you have received a 400 BAD Request Error. Is it possible that your environment has userPrincipalName set as the Username attribute? If so, please make sure to include the parameter UserAttribute and set it to either UPN or userPrincipalName (e.g. -UserAttribute UPN)"
Write-Error -Exception $_.Exception -Message "Is it possible that your environment has userPrincipalName set as the Username attribute? If so, please make sure to include the parameter UserAttribute and set it to either UPN or userPrincipalName (e.g. -UserAttribute UPN)`n`n$($_)" -ErrorAction Stop
} else {
Write-Host -ForegroundColor White -BackgroundColor DarkGray "Unfortunately, you have received a 400 BAD Request Error. It is possible that the Username you provided, $Username, is missing a domain (e.g. $Username@domain.com)?"
Write-Error -Exception $_.Exception -Message "It is possible that the Username you provided, $Username, is missing a domain (e.g. $Username@domain.com)?`n`n$($_)" -ErrorAction Stop
}
}

Expand Down

0 comments on commit c6c50a2

Please sign in to comment.