Skip to content

Instantly share code, notes, and snippets.

View rfennell's full-sized avatar

Richard Fennell rfennell

View GitHub Profile
@rfennell
rfennell / UpdateNVDDBFromBuildArtifact.yml
Last active June 29, 2026 08:57
Azure DevOps Pipeline Maintenance Jobs to update NVD DB on multiple agents
# This is the pipeline that runs any scheduled maintainance jobs
# we wish to run in addition to the built in Azure DevOps Maintainance jobs
name: "Update NVD Database on $(agent)"
# The parameters to target each pool and agent
parameters:
- name: pool
type: string
default: ''
- name: agent
@rfennell
rfennell / Clone-AllReposInAzDoOrg.ps1
Created January 23, 2026 09:27
Clone All Repos In Azure DevOps Organisation
<#
.SYNOPSIS
Lists all Git repositories across all projects in an Azure DevOps organization and supports multiple output formats or cloning locally.
.DESCRIPTION
This script enumerates all projects in an Azure DevOps organization using the Azure CLI DevOps extension, then lists Git repositories for each project.
It can output repository metadata in `json`, `csv`, or `table` formats, emit clone `urls` (HTTPS/SSH/both), or `clone` all repositories locally using `git`.
Prerequisites:
- Azure CLI installed and logged in (`az login`).
@rfennell
rfennell / check-vss2Gitexport.ps1
Last active June 30, 2026 13:27
A set of scripts to help export Visual Sourcesafe content to GitHub
param (
$projectfile = "projects.csv", # list of projects to export
$folderPath = "D:\Git1",
$searchText = "Git export complete in",
$analysisFile = "analysis.csv",
$org = "MyOrg",
$failedProjectFile = "failedprojects.csv",
$outdatedProjectFile = "outdatedprojects26.csv"
)
@rfennell
rfennell / export-svntip2git.ps1
Created June 27, 2025 10:55
Exports branches from SVN and creates a Git repo (no history)
param
(
$localrepopath = "c:\svn\localrepo",
$trunkurl = "svn://svnlive.mydomain/application/trunk",
[string[]]$branches = @(
"svn://svnlive.mydomain/application/releases/1.0.0",
"svn://svnlive.mydomain/application/releases/2.0.0"
)
)
@rfennell
rfennell / workflow-rev-sample.yml
Last active June 17, 2025 14:45
A sample GitHub Actions Workflow that provides the same behaviour as the Azure DevOps Pipeline $(rev:r) build name i,e, counts the runs of a named build on the current date
name: Workflow Rev Sample
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# You have to grant the actions read permission else the GH CLI get a 403 error
permissions:
@rfennell
rfennell / Generate-AzdoInheritedProcessUpdateCommands.ps1
Created June 5, 2025 13:26
A PowerShell script to generate SQL commands to update inherited process template WITD display names based on error in an Azure DevOps Migration error log
param (
$logfile = "DataMigrationTool.log",
$tpcUrl = "http://server:8080/tfs/defaultcollectio",
$outputFile = "update-fields.sql"
)
$Errors = @{}
function Get-ItemFromRow {
param (
$row,
$startString,
@rfennell
rfennell / Generate-AzdoXmlProcessUpdateCommands.ps1
Created June 5, 2025 12:45
A PowerShell script to generate WITAdmin commands to update XML process template WITD display names based on error in an Azure DevOps Migration error log
aram (
$logfile = "DataMigrationTool.log",
$tpcUrl = "http://server:8080/tfs/defaultcollection",
$witAdminPath = "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\witadmin.exe",
$outputFile = "update-fields.ps1"
)
$Errors = @{}
function Get-ItemFromRow {
param (
$row,
@rfennell
rfennell / export-ado-testsuite.py
Last active May 28, 2025 16:29
A Python script to export all Azure DevOps Test Suites in a Team Project as Excel files (replicated the Azure DevOps UI Export button)
import requests
import base64
import os
import argparse
def download_testcases_excel(organization, project, pat, test_case_ids, test_plan_id, test_suite_id, output_path):
"""
Download test cases as an Excel file from Azure DevOps Test Plan API.
"""
api_url = f"https://dev.azure.com/{organization}/{project}/_apis/testplan/TestCases/TestCaseFile?api-version=7.1-preview.1"
@rfennell
rfennell / Get-AZDOPipelineDetailsForAllProjects.ps1
Last active May 16, 2025 13:53
This script connects to an Azure DevOps organization using a Personal Access Token (PAT). It enumerates all projects within the organization, retrieves all pipelines for each project, and gathers details about each pipeline, including type (YAML or Classic), source repository, default branch, repository URL, and the status and time of the latest…
<#
.SYNOPSIS
Retrieves pipeline information for all projects in an Azure DevOps organization and exports it to a CSV file.
.DESCRIPTION
This script connects to an Azure DevOps organization using a Personal Access Token (PAT).
It enumerates all projects within the organization, retrieves all pipelines for each project,
and gathers details about each pipeline, including type (YAML or Classic), source repository,
default branch, repository URL, and the status and time of the latest run.
The collected information is exported to a specified CSV file.
.PARAMETER organization
@rfennell
rfennell / Get-AZDOPipelineDetailsForProject.ps1
Last active May 16, 2025 13:41
This script connects to an Azure DevOps organization and project using a Personal Access Token (PAT). It fetches all pipelines, gathers details about each pipeline (including type, source repository, branch, and latest run status), and exports the collected information to a CSV file.
<#
.SYNOPSIS
Retrieves Azure DevOps pipeline information and exports it to a CSV file.
.DESCRIPTION
This script connects to an Azure DevOps organization and project using a Personal Access Token (PAT).
It fetches all pipelines, gathers details about each pipeline (including type, source repository, branch, and latest run status),
and exports the collected information to a CSV file.
.PARAMETER organization