How do test if the number of characters in $dbUserName is more than eight characters?
I have been unable to locate a command or series of commands that will let me do this. I have only been able to find if the variable is null:
if ($dbUserName) {
Write-Output " You left Username blank"
$dbUserName = read-host
}
But I would like to next test like this:
if ($dbUserName [String] > 8 ) }
Write-Output " Please enter more than 8 characters "
$dbUserName=read-host " Re-enter database user name"
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…