Skip to content

Instantly share code, notes, and snippets.

@chriskuech
Created June 11, 2019 06:06
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/131837e70cfb1e29e43e473f0219a94c to your computer and use it in GitHub Desktop.
Save chriskuech/131837e70cfb1e29e43e473f0219a94c to your computer and use it in GitHub Desktop.
class Computer {
[string] $Service
[string] $ClusterId
[string] $DatacenterId
[string] $Id
Computer([string]$Id) {
$this.Id = $Id
if ($Id -notmatch "(\w+)(\d+)(\w+\d+)") {
throw "Invalid Computer ID '$Id'"
}
$_, $this.Namespace, $this.ClusterId, $this.DatacenterId = $Matches
}
}
class AuditResult {
[boolean] $Healthy
[Computer] $Computer
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment