Skip to content

Instantly share code, notes, and snippets.

View codebytes's full-sized avatar

Chris Ayers codebytes

View GitHub Profile
@codebytes
codebytes / export-ado.sh
Last active August 14, 2023 20:56
export-ado-workitems.sh
#!/bin/sh
org=https://dev.azure.com/ChrisAyersFTA
project=Sample
saName=cayersadotestsa
saContainer=ado
az extension add --name azure-devops --upgrade -y
az devops project list --org=$org -o table
@codebytes
codebytes / updateRepos.sh
Created March 30, 2023 17:24
a script to loop through all source repos and update the default branch from master to main
#!/bin/bash
if ! command -v gh >/dev/null 2>&1; then
echo "Install gh first"
exit 1
fi
echo "gh cli installed"
# This script
if ! gh auth status >/dev/null 2>&1; then
ACR_NAME=
AKS_RESOURCE_GROUP=
AKS_AAD_ADMIN_GROUP=
AKS_CLUSTER_NAME=
AAD_TENANT_ID=
VNET_SUBNET_ID=
VNET_SERVICE_CIDR=
VNET_DNS_SERVICE_IP=
SSH_KEY=
AKS_CLUSTER_IDENTITY_NAME=
@codebytes
codebytes / DevMachineSetup.ps1
Last active October 13, 2024 12:44
DevMachineSetup
#Install WinGet
#Based on this gist: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
"Installing winget Dependencies"
Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
$releases_url = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
// Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse);
public class Flags
{
}
public class Settings
{
public Flags flags { get; set; }
}
@codebytes
codebytes / nuget-install.ps1
Last active July 14, 2024 01:10
Powershell script to install nuget and update path
$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$targetPath = "C:\Program Files\nuget"
if (-not (Test-Path -LiteralPath $targetPath)) {
try {
New-Item -Path $targetPath -ItemType Directory -ErrorAction Stop | Out-Null #-Force
}
catch {
Write-Error -Message "Unable to create directory '$targetPath'. Error was: $_" -ErrorAction Stop