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 Rename-Subtitles { | |
[CmdletBinding()] | |
Param | |
( | |
[parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true)] | |
[ValidateScript({Test-Path $_})] | |
[String] | |
$Path, | |
[parameter(Mandatory = $false)] | |
[String] |
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
# Run from PowerShell | |
$aliasList = @( | |
"a = !git add . && git status" | |
"aa = !git add . && git add -u . && git status" | |
"ac = !git add . && git commit" | |
"acm = !git add . && git commit -m" | |
"alias = !git config --get-regexp '^alias\.' | sort" | |
"amend = !git add -A && git commit --amend --no-edit" | |
"au = !git add -u . && git status" |
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 Update-Release { | |
[CmdletBinding(DefaultParameterSetName = "UseDefaultCredentials")] | |
Param ( | |
[parameter(Mandatory = $true,ParameterSetName = "PAT")] | |
[String] | |
$User, | |
[parameter(Mandatory = $true,ParameterSetName = "PAT")] | |
[String] | |
$PersonalAccessToken, | |
[parameter(Mandatory = $false,ParameterSetName = "UseDefaultCredentials")] |
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
# Recreation of the example found here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-document.html | |
$ssmDocContent = [PSCustomObject]@{ | |
schemaVersion = "1.2" | |
description = "Join instances to an AWS Directory Service domain." | |
parameters = @{ | |
directoryId = @{ | |
type = "String" | |
description = "(Required) The ID of the AWS Directory Service directory." | |
} |
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
try { | |
Import-Module posh-git -ErrorAction Stop | |
} | |
catch { | |
Install-Module posh-git -Scope CurrentUser -Repository PSGallery | |
Import-Module posh-git | |
} | |
function Get-PSVersion { | |
<# | |
.SYNOPSIS |
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
<# | |
This is my ever growing collection of PowerShell / workstation configuration bits. | |
#> |
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 Convert-Duration { | |
<# | |
.SYNOPSIS | |
Converts a TimeSpan or ISO8601 duration string to the desired output type. | |
.DESCRIPTION | |
Converts a TimeSpan or ISO8601 duration string to the desired output type. | |
More info on ISO8601 duration strings: https://en.wikipedia.org/wiki/ISO_8601#Durations |
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( | |
[Parameter(Position = 0)] | |
[String] | |
$ProjectName = $(Split-Path $PWD.Path -Leaf) | |
) | |
$env:_BuildStart = Get-Date -Format 'o' | |
New-Variable -Name IsCI -Value $($IsCI -or (Test-Path Env:\TF_BUILD)) -Scope Global -Force -Option AllScope |
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
"editor.tokenColorCustomizations": { | |
"textMateRules": [ | |
{ | |
"name": "Italics", | |
"scope": [ | |
"comment", | |
"punctuation.definition.comment", | |
"keyword", | |
"storage", | |
"entity.other.attribute-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
class Backgrounder { | |
[string[]] $Updates | |
Backgrounder(){} | |
[void] AddUpdate([string]$update) { | |
$this.Updates += $update | |
} | |
[void] Update() { | |
1..5 | ForEach-Object { | |
# ThreadJob | |
Start-ThreadJob -Name {$_} -ArgumentList $_ -ScriptBlock { |
OlderNewer