This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: 'stable', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function div($n, $d) {$n / $d} # a seemingly pure function | |
div 1 0 # throws 'Attempted to divide by zero' error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ErrorActionPreference = "Stop" | |
function Assert-True { | |
[CmdletBinding()] # add ErrorAction support | |
Param([boolean]$Value) | |
if (-not $Value) { | |
throw "Failed assertion" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Select-ClusterSetPartialConfig ".\Configs" "PROD-EU-NorthEurope" ` | |
| Sort-Object ` | |
| % {$_ | Get-Content | ConvertFrom-Json} ` | |
| Merge-Object -Strategy Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Select-ClusterSetPartialConfig ".\Configs" "PROD-EU-NorthEurope" ` | |
| % {$_ | Get-Content | ConvertFrom-Json} ` | |
| Merge-Object -Strategy Fail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Select-ClusterSetPartialConfig([string]$Container, [string[]]$Vector) { | |
$clusterId = $Vector -join "-" | |
Get-ChildItem $Container ` | |
| ? {$clusterId -like ($_.BaseName -replace "_", "*")} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# constant parameters | |
$org = "MyAzureDevOpsOrgName" | |
$project = "MyAzureDevOpsProjectName" | |
$areaPath = "/the/area/path/containing/my/work/items" | |
$tag = "the-tag-that-identifies-work-items-as-automanaged" | |
$query = @" | |
SELECT * | |
FROM WorkItems | |
WHERE [Tags] CONTAINS '$tag' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
# Path to the repo containing TODO-annotated files | |
[Parameter(Mandatory)] | |
[ValidateScript({Test-Path $_ -PathType Container})] | |
[string]$RepoRoot | |
) | |
& { | |
enum Priority { | |
Low = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... # previous param definition | |
& { | |
... # previous class and enum definitions | |
... # previous transformations | |
} | Sort Priority, FilePath, Line |