Skip to content

Instantly share code, notes, and snippets.

@deangrant
Last active October 7, 2015 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deangrant/0e62d6b2925b88f3fd37 to your computer and use it in GitHub Desktop.
Save deangrant/0e62d6b2925b88f3fd37 to your computer and use it in GitHub Desktop.
Snippet for validating email address in Create-EmailHash function
[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