if ($dbUserName.length -le 8) {
Write-Output "Please enter more than 8 characters."
$dbUserName = Read-Host "Re-enter database username"
}
Although it is stated in the comments section, the logic is not correct in the accepted answer and more than a hundred voters didn't actually care about this.