Skip to content

Instantly share code, notes, and snippets.

@chriskuech
Last active April 15, 2019 06:51
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 chriskuech/f009bd0466b9638f6d780e40d92f6119 to your computer and use it in GitHub Desktop.
Save chriskuech/f009bd0466b9638f6d780e40d92f6119 to your computer and use it in GitHub Desktop.
# Ensure a path exists
[ValidateScript({Test-Path $_})]
$path
# Ensure a non-empty value
[ValidateNotNullOrEmpty()]
$value
# Ensure a string meets a certain convention
[ValidatePattern("^[a-z]+-[a-z]+-[a-z]+-[0-9]+$")]
$identifier
# Ensure a string is a predefined symbol
[ValidateSet("DEV", "INT", "TEST", "STAGE", "CANARY", "PROD")]
$flightingRing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment