如何检测$dbUserName中字符数量是否超过八个?
我一直无法找到一个能让我实现此目的的命令或一系列命令。我只能发现变量是否为空:
if ($dbUserName) {
Write-Output " You left Username blank"
$dbUserName = read-host
}
但我希望下一次测试是这样的:
if ($dbUserName [String] > 8 ) }
Write-Output " Please enter more than 8 characters "
$dbUserName=read-host " Re-enter database user name"
}