Skip to content

Instantly share code, notes, and snippets.

@chriskuech
Created April 14, 2019 18:10
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/5bbfbf008006724b69cf89b21041011c to your computer and use it in GitHub Desktop.
Save chriskuech/5bbfbf008006724b69cf89b21041011c to your computer and use it in GitHub Desktop.
class Cluster {
[ValidatePattern("^[A-z]+$")]
[string] $Service
[ValidateSet("TEST", "STAGE", "CANARY", "PROD")]
[string] $FlightingRing
[ValidateSet("EastUS", "WestUS", "NorthEurope")]
[string] $Region
[ValidateRange(0, 255)]
[int] $Index
[string] ToString() {
return $this.Service, $this.FlightingRing, $this.Region, $this.Index -join "-"
}
}
$cluster = [Cluster]@{
Service = "MyService"
FlightingRing = "PROD"
Region = "EastUS"
Index = 2
}
Write-Host "We just created a model for '$cluster'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment