Skip to content

Instantly share code, notes, and snippets.


Pieter Gheysens pietergheysens

View GitHub Profile
pietergheysens / AsOfWiqlQueryToFixIterationPath.ps1
Created Jan 10, 2020
Fix Iteration Path of work items based on values of the as of parameter in a Azure DevOps WIQL query
View AsOfWiqlQueryToFixIterationPath.ps1
$token = ""
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f "azdo",$token)))
$uri = "{organisation}/{teamproject}/_apis/wit/wiql?api-version=5.1"
$body = @"
"query": "Select [System.Id], [System.Title], [System.State] From WorkItems
Where [System.TeamProject] = {teamproject} AND [System.WorkItemType] <> 'Test Case'
asof '2020-01-08T10:00:00.000Z'"}
pietergheysens / CreateVSALMVMs.ps1
Created Jan 3, 2018
Create Visual Studio ALM Virtual Machines based on specialized vhd file in Microsoft Azure
View CreateVSALMVMs.ps1
Select-AzureRmSubscription -SubscriptionId "<yoursubscriptionid>"
$destinationResourceGroup = Read-Host -Prompt "What's the desired resource group name?"
$numberOfVMs = Read-Host -Prompt "How many VMs do you want to generate?"
$location = "West Europe"
$vmSize = "Standard_F4s_v2"
$accountType = "PremiumLRS"
pietergheysens / Program.cs
Created Sep 12, 2016
Move inline images of work item description field to VSTS
View Program.cs
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.WorkItemTracking.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
View KeepBuildForever.ps1
[string] $PATPassword
$username = "POC-GetBuildDetails"
$basicAuth = ("{0}:{1}" -f $username,$PATPassword)
$basicAuth = [System.Text.Encoding]::UTF8.GetBytes($basicAuth)
$basicAuth = [System.Convert]::ToBase64String($basicAuth)
View DestroyDeletedBranchesInTFS.ps1
Write-Host "*** Find deleted branches in TFS and destroy if not used in last 100 days ***" -ForegroundColor Yellow
Add-PSSnapin Microsoft.TeamFoundation.PowerShell
$tfsServer = Get-TfsServer -name http://<tfsserver>:8080/tfs/<tpccollection>
$destroyList = get-tfschilditem -item <versioncontrolpath> -server $tfsServer -Deleted | Where {$_.DeletionId -ne 0 -and $_.CheckinDate -lt (Get-Date).AddDays(-100)}
$deletedBranchesFound = $destroyList.Count
Write-Verbose "Found $deletedBranchesFound deleted branches for starting the destroy command ..." -Verbose
View Update-AssemblyInfoVersionFiles.ps1
function Update-AssemblyInfoVersionFiles
$buildNumber = $env:BUILD_BUILDNUMBER
if ($buildNumber -eq $null)
You can’t perform that action at this time.