Skip to content

Instantly share code, notes, and snippets.

@chriskuech
Created June 12, 2019 18:42
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/3a5dc8ae3816d4a54ad89bb439631f78 to your computer and use it in GitHub Desktop.
Save chriskuech/3a5dc8ae3816d4a54ad89bb439631f78 to your computer and use it in GitHub Desktop.
class Requirement {
[string] $Name
[scriptblock] $Test
[scriptblock] $Set
}
$mySystem = [System.Collections.ArrayList]::new()
$requirements = [Requirement[]]@(
@{
Name = "Resource 1"
Test = {$mySystem -contains 1}
Set = {$mySystem.Add(1); Start-Sleep 1}
},
@{
Name = "Resource 2"
Test = {$mySystem -contains 2}
Set = {$mySystem.Add(2); Start-Sleep 1}
},
@{
Name = "Resource 3"
Test = {$mySystem -contains 3}
Set = {$mySystem.Add(3); Start-Sleep 1}
},
@{
Name = "Resource 4"
Test = {$mySystem -contains 4}
Set = {$mySystem.Add(4); Start-Sleep 1}
},
@{
Name = "Resource 5"
Test = {$mySystem -contains 5}
Set = {$mySystem.Add(5); Start-Sleep 1}
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment