Skip to content

Instantly share code, notes, and snippets.

View scbedd's full-sized avatar

Scott Beddall scbedd

  • Microsoft
  • Seattle, WA
View GitHub Profile
@scbedd
scbedd / transition-versioning-strategy.ps1
Last active March 20, 2020 00:11
Powershell Github.io Versioning v1 -> v2 Transition Script
# transition old style versioning strategy to new. inclusive of existing versions in both strategies
param (
$AzCopy,
$SASKey,
$Language,
$BlobName,
$DocLocation,
$AccountKey
)
@scbedd
scbedd / get_prs_with_readme.ps1
Last active June 11, 2019 18:15
A little script to get active PRs that affect a readme
# A little script to get active PRs that affect a readme
#
# There are limitations here. Note that pulling the files list associated with a PR does have a maximum. I wouldn't trust this scripts
# to properly assess PRs that have more than 300 files modified.
#
# To get a GITHUB Token: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line
#
# EXAMPLE USAGE (from powershell)
#
# ./get_prs_with_readme.ps1 -labelFilter Dev -gh_token <YOUR GITHUB PAT> -repoName release-testing -repoOwner scbedd
@scbedd
scbedd / create_venv.ps1
Last active June 10, 2019 21:36
Boilerplate PShell script that will clean and recreate a virtual environment in the local directory under a foldername of your choosing
Function Create-Virtual-Environment([String] $envName = "venv") {
$cwd = Get-Location
$relativePath = Join-Path -Path $cwd -ChildPath $envName
$pathToDeactivate = Join-Path -Path $relativePath -ChildPath "Scripts/deactivate.bat"
# if it already exists make certain to deactivate it
if(Test-Path $pathToDeactivate -PathType Leaf)
{
& $pathToDeactivate
@scbedd
scbedd / interrogate_active_prs.ps1
Created May 16, 2019 07:11
A little script to get all active PRS from a github repo. Filter by a label if you wish.
# A little script to get all active PRS from a github repo. Filter by a label if you wish.
#
#
# EXAMPLE USAGE
#
# ./interrogate_active_prs.ps1 -labelFilter Dev -gh_token <YOUR GITHUB PAT> -repoName release-testing -repoOwner scbedd
#
# or copy this script locally, set the default repo and owner, set and environment variable of name GH_TOKEN with your PAT, and
# run it simply with a labelfilter if you want.
param (
@scbedd
scbedd / helpful_regex.md
Created April 11, 2019 22:52
Helpful Regex

Match a release note

(?<releaseNote>\#\s(?<releaseDate>[\-0-9]+)\s-\s(?<version>(\d+)(\.(\d+))?(\.(\d+))?(([^0-9][^\s]+)))(?<releaseText>((?!\s# )[\s\S])*))

Where the form this matches is

# <random text> <version specifier>
<release note content
@scbedd
scbedd / tags_since.x.ps1
Created April 11, 2019 18:01
Want to get a list of tags from a git repo?
Function Tags-Since([String] $datesSince = "2019-04-01") {
git rev-parse --is-inside-work-tree
if($LastExitCode -ne 0)
{
Write-Host "Please invoke this function from within a git repository folder. Exiting."
exit(1)
}