Last active
October 7, 2015 12:26
-
-
Save deangrant/0e62d6b2925b88f3fd37 to your computer and use it in GitHub Desktop.
Snippet for validating email address in Create-EmailHash function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory=$True, ValueFromPipeline=$True, HelpMessage="Enter an email address to compute hash")] | |
[ValidateScript({"\b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}\b"})] | |
[String[]]$Email | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment