Skip to content

Instantly share code, notes, and snippets.

@nohwnd
Created October 28, 2016 10:58
Show Gist options
  • Save nohwnd/731b6aee73f4bf60888861ed1454cefa to your computer and use it in GitHub Desktop.
Save nohwnd/731b6aee73f4bf60888861ed1454cefa to your computer and use it in GitHub Desktop.
function Test-UserName ($Name)
{
$Name -match "^[a-z]+$"
}
Test-UserName $null
Test-UserName ""
Test-UserName "_abc"
Test-UserName "abc1"
Test-UserName "abc "
Test-UserName "ab c"
Test-UserName "nohwnd"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment