Skip to content

Instantly share code, notes, and snippets.

View Ryanman's full-sized avatar
💭
Triggering

Ryan McElroy Ryanman

💭
Triggering
View GitHub Profile
@Ryanman
Ryanman / CloneAllAzureDevOpsRepositories.ps1
Created April 26, 2021 20:06
Clones all the repositories in an Azure DevOps collection in a well-organized folder structure
#Ensure you create a PAT, following the instructions here: https://dev.to/omiossec/getting-started-with-azure-devops-api-with-powershell-59nn
#Additional Credit: https://blog.rsuter.com/script-to-clone-all-git-repositories-from-your-vsts-collection/
#I suggeste executing from C:/Projects. This script will create a folder for each Team Project/Client with repos within each.
#Finally note that git clone operations count as "Errors" in powershell, and appear red. It's more work than is worth it to change it.
param(
[string] $email = $(Throw "--Email is required."), #required parameter
[string] $pat = $(Throw "--PAT is Required"), #required parameter
[string] $url = $(Throw "--Collection URL is required.") #required parameter pointing to the default collection, URL is generally https://{tenant}.visualstudio.com/defaultcollection
)
@Ryanman
Ryanman / HttpResponseExtensions.cs
Last active April 26, 2021 20:07
Create a snake-case HTTP response in ASP.NET
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace Hylaine.Shared.Extensions
{
public static class HttpResponseExtensions
{