Skip to content

Instantly share code, notes, and snippets.

View joshjohanning's full-sized avatar
🐢
On leave Apr 4-July 13

Josh Johanning joshjohanning

🐢
On leave Apr 4-July 13
View GitHub Profile
@joshjohanning
joshjohanning / migrate-nuget-packages.sh
Last active January 26, 2021 18:14
Migrate NuGet Packages script
echo -n "NuGet feed name?"
read nugetfeed
echo -n "NuGet feed source?"
read nugetsource
echo -n "Enter PAT"
read pat
# adding to ~/.config/NuGet/NuGet.config
nuget sources add -Name $nugetfeed -Source $nugetsource -username "az" -password $pat
results=$(find . -name "*.nupkg")
resultsArray=($results)
@joshjohanning
joshjohanning / vsts-sync-migration-tools.md
Last active September 30, 2021 00:54
VSTS Sync Migration Tools

VSTS Sync Migration Tools - v7.5.x (circa 2019)

The VSTS Sync Migration tools allow you to bulk edit and migrate data between Team Projects on both Microsoft Team Foundation Server (TFS) and Visual Studio Team Services (VSTS). You can find out why this tooling exists and you can access the documentation to find out how. THis project is published as code on GitHub as well as a VSTS Sync Migration Tools on Chocolaty and VSTS Bulk Data Editor Engine on NuGet. This allows you to build your own tooling as well as just use it out of the box with a configuration file.

Quick Links from Original Author

@joshjohanning
joshjohanning / configuration.json
Created September 30, 2021 05:04
configuration.json for nkdAgility/azure-devops-migration-tools - v8.9.x
{
"Version": "8.9",
"TelemetryEnableTrace": false,
"workaroundForQuerySOAPBugEnabled": false,
"Source": {
"Collection": "https://dev.azure.com/org",
"Project": "project",
"ReflectedWorkItemIDFieldName": "Custom.ReflectedWorkItemId",
"AllowCrossProjectLinking": false,
"PersonalAccessToken": ""
@joshjohanning
joshjohanning / storage_account.tf
Created October 27, 2021 15:01
private / locked down storage account sample
# This template is used to deploy the storage account resources
resource "azurecaf_name" "storage_account" {
name = "msi"
resource_type = "azurerm_storage_account"
prefixes = local.regional_name_prefixes
suffixes = local.azurecaf_name_suffixes
clean_input = true
}
@joshjohanning
joshjohanning / github-cleanup-notifications.ps1
Last active November 16, 2021 22:20
Delete notification subscriptions for a specific org
##############################################################
# Delete all notification subscriptions for a specific org
##############################################################
# Description: You may have to run this multiple times - but it's better than:
# a) unwatching all repos or
# b) clicking thru yourself to unwatch
#
# See watched repos here: https://github.com/watching
@joshjohanning
joshjohanning / github-ghas-compare.md
Last active December 3, 2021 23:18
GitHub Advanced Security Compare
@joshjohanning
joshjohanning / azdo-create-iterations.ps1
Created September 30, 2021 01:38
Azure DevOps - Create Iterations PowerShell Script
# The iteration CSV should look something like this (no header):
# 20.6\1\1
# 20.6\1\2
# 20.6\2\1
# 20.6\2\2
# 19.1
# 19.1\1
# 19.1\1\2
# 19.3
@joshjohanning
joshjohanning / github-get-package-version-download
Last active January 7, 2022 19:55
Get package version download url for a specific package and specific version
{
repository(owner: "joshjohanning", name: "Wolfringo-github-packages") {
packages(first: 10, packageType: NUGET, names: "Wolfringo.Commands") {
edges {
node {
id
name
packageType
version(version: "1.1.2") {
id
@joshjohanning
joshjohanning / action.yml
Created January 12, 2022 23:13
use an app id, installation id, and private key to clone a repo with github apps
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
@joshjohanning
joshjohanning / vulnerability.js
Created January 13, 2022 17:31
introduce code vulnerability in ghas
function endsWith(x,y) {
let index = x.lastIndexOf(y);
return x.lastIndexOf(y) === x.length - y.length;
}
// comment