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 Invoke-WithStorageAccount { | |
Param( | |
[ValidateNotNullOrEmpty()] | |
[scriptblock]$ScriptBlock | |
) | |
$name = ("s$(New-Guid)" -replace "-").Substring(24) | |
$storageAccount = New-AzStorageAccount ` | |
-ResourceGroupName "ephemeral-storages" ` | |
-Name $name` |
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
Invoke-InDirectory $RepoRoot { | |
Invoke-InContext "Build ReactJS App" { | |
Invoke-InContext "Validate" { | |
Invoke-InContext "Lint" { yarn lint } | |
Invoke-InContext "Test" { yarn test } | |
} | |
Invoke-InContext "Transpile" { yarn build:ts } | |
Invoke-InContext "Bundle" { yarn webpack } | |
} | |
Invoke-InContext "Build Container" { docker build . } |
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
# ContextLogger.psm1 | |
$ContextStack = [System.Collections.Stack]::new() | |
function Invoke-InContext { | |
Param( | |
[ValidateNotNullOrEmpty()] | |
[string] $Name, | |
[ValidateNotNullOrEmpty()] | |
[scriptblock] $ScriptBlock |
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
# invoke in repo root | |
Invoke-InDirectory "$PSScriptRoot/.." { | |
Invoke-InDirectory "./components" { | |
npm install | |
npm build | |
} | |
Invoke-InDirectory "./server" { | |
npm install | |
npm build | |
} |
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 Invoke-InDirectory { | |
Param( | |
[ValidateScript( { Test-Path $_ -PathType Container } )] | |
[string] $Path, | |
[ValidateNotNullOrEmpty()] | |
[scriptblock] $ScriptBlock | |
) | |
try { | |
Push-Location $Path |
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" | |
Push-Location "./path/I/need/to/be/in" | |
try { | |
# do something here | |
} finally { | |
Pop-Location | |
} |
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
# 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 |
NewerOlder