Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $name = Read-Host "Username?"
- Switch ($name.length)
- {
- {$_ -le 3} {"Name is too short min required is 3 chars yours is $_"}
- {$_ -gt 50} {"Name is too long max allowed is 50 chars yours is $_"}
- {$_ -gt 3 -and $_ -le 50} {"Name is good with $_ chars long"}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement