Skip to content

Instantly share code, notes, and snippets.

View Tiberriver256's full-sized avatar
📚
Still learning

Micah Rairdon Tiberriver256

📚
Still learning
View GitHub Profile
@Tiberriver256
Tiberriver256 / Get-BuildPipelineScopedChanges.ps1
Created August 28, 2024 23:29
A PowerShell script to get associated work items for an Azure DevOps build
#Requires -PSEdition Core
<#
.SYNOPSIS
Retrieves distinct commits and associated work items for a build pipeline... with support for monorepos!
See the blog post at https://tiberriver256.github.io/DevOps/azure-devops-pipelines-related-work-items-monorepo for more information.
.DESCRIPTION
This script retrieves the distinct commits and associated work items for a build pipeline. It requires the following parameters:
@Tiberriver256
Tiberriver256 / FeatureFileSplitter.csproj
Created December 18, 2023 17:02
A simple console app for splitting SpecFlow feature files. The aim here is to support scenario level parallelization, which is not natively supported in SpecFlow.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
@Tiberriver256
Tiberriver256 / Update-TaskGroupInputParameter.ps1
Created February 7, 2023 19:44
Update an Azure DevOps Task Group Input Parameter type from string to a multiLine string
# NOTE:
# This change will probably be reverted the next time you save the task group in the UI... I am sorry
$MyPat = "INSERT_PAT_TOKEN_WITH_TASK_GROUP_SCOPES"
$TaskGroupId = "INSERT_TASK_GROUP_ID"
$Organization = "INSERT_ORGANIZATION"
$Project = "INSERT_PROJECT"
$VariableToChange = "INSERT_VARIABLE_NAME_YOU_WANT_MULTILINE"
@Tiberriver256
Tiberriver256 / Get-GitLogStats.ps1
Last active December 4, 2022 18:39
Runs a git log in PowerShell and prints options as a PowerShell custom object
<#
.SYNOPSIS
Runs a git log in PowerShell and prints options as a PowerShell custom object
.EXAMPLE
PS> Get-GitLogStats -CommitHash -AuthorName -AuthorEmail -AdditionalArgs '--since="30 days ago"'
CommitHash AuthorName AuthorEmail
---------- ---------- -----------
5426c8744a7fa3a602122738415ab32c80f2c1ad Micah Rairdon [email protected]
5427c8744a7fa3a602122738415ab32c80f2c1ad Micah Rairdon [email protected]
@Tiberriver256
Tiberriver256 / Get-AzureDevOpsAgentSpecifications.ps1
Last active October 16, 2021 21:44
Used to generate a report of Azure DevOps agent specifications to determine which classic build/release definitions are using different operating systems
Import-Module VSTeam
function Get-AzureDevOpsAgentSpecifications {
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]
$Account,
@Tiberriver256
Tiberriver256 / Get-DadJokeIpsum.ps1
Created July 23, 2021 13:55
Get me some dad jokes
<#
.SYNOPSIS
Get some filler text that is dad jokes
.PARAMETER minLength
The minimum length of text you need
PS> Get-DadJokeIpsum -minLength 500
Where did Captain Hook get his hook? From a second hand store. Why was the broom late for the meeting? He overswept. Dad, can you put my shoes on? I don't think they'll fit me. For Valentine's day, I decided to get my wife some beads for an abacus. It's the little things that count. Why is the ocean always blue? Because the shore never waves back. How does a dyslexic poet write? Inverse. Whiteboards ... are remarkable. Want to hear a joke about construction? Nah, I'm still working on it. Why do scuba divers fall backwards into the water? Because if they fell forwards theyâd still be in the boat. Some people say that comedians who tell one too many light bulb jokes soon burn out, but they don't know watt they are talking about. They're not that bright. Don't trust atoms. They make up everything. I am terrified of elevators. Iâm going to start taking steps to
<#
.SYNOPSIS
Copy files using your clipboard and PowerShell
.DESCRIPTION
The file specified at $Path is converted to a base64 string, wrapped with a tiny script that converts the base64 string
back to binary and saves it at the path specified in the $Destination parameter
#>
function Copy-PasteItem {
[CmdletBinding()]
@Tiberriver256
Tiberriver256 / index.html
Last active January 9, 2020 19:21
scrollable-menu
<html>
<body>
<table style="width: 100%; overflow-x: hidden; table-layout: fixed;">
<tbody>
<tr>
<td style="text-align: center; width: 200px; border-right: solid;">
<h1>Product</h1>
<img src="https://media.haworth.com/image/117471/s800/fern_linkedin_50x50_1-(1).jpg" style="max-height: 100px;" />
</td>
<td style="padding-left: 20px">
## Git
cinst -y git.install
cinst -y poshgit
cinst -y Git-Credential-Manager-for-Windows
cinst -y visualstudiocode
@Tiberriver256
Tiberriver256 / FindPortProcessName.ps1
Created March 12, 2019 14:33
Gets the process name and PID for a given port
$Port = "8080"
netstat -a -n -o | where { $_ -match $Port } | foreach {
$Process = Get-Process -PID (($_ -replace "\s+"," ") -split " ")[-1]
"Process: $($Process.ProcessName) ($($Process.Id)) is using $Port"
}