Skip to content

Instantly share code, notes, and snippets.

View stephengodbold's full-sized avatar

Steve Godbold stephengodbold

View GitHub Profile
@stephengodbold
stephengodbold / Set-LocalDevEnvironment.ps1
Created September 9, 2014 01:13
Setup a development environment for IISExpress using *.localtest.me
#requires -version 2.0
param(
[Parameter(Mandatory = $true)]
[string]
$project,
[Parameter(Mandatory = $true)]
[string]
$hostname,
@stephengodbold
stephengodbold / SteveGodbold.TFS.Branding.js
Last active August 29, 2015 14:03
A TFS Web Extension to drop a custom footer onto the home pages for a project collection, and a team project.
TFS.module("SteveGodbold.TFS.Branding", ["TFS.Host","TFS.Admin"], function(){
function buildFooter() {
return '<div id="page-footer"><p>YOUR CONTENT HERE</p></div>';
}
function setFooter(footer) {
$('.content-section').after(footer)
$('#page-footer').css({
"display" : "block",
@stephengodbold
stephengodbold / SteveGodbold.TFS.Analytics.js
Created July 1, 2014 07:57
A TFS Web Extension to load Google Analytics into the page, and log a simple page view event
TFS.module("SteveGodbold.TFS.Analytics", [], function(){
function resolveAnalyticsId() {
var currentHost = window.location.hostname;
if (currentHost.indexOf('some-url') {
return 'UA-00000000-1';
}
return 'UA-00000000-2';
}
param(
[parameter()]
[string]
$repositoryRoot,
[parameter()]
[string]
$installRoot = $env:ProgramFiles
)
public class SearchHub
{
private readonly IEnumerable<IRepository> repositories;
public SearchHub(IEnumerable<IRepository> repositories)
{
this.repositories = repositories;
}
public IEnumerable<WorkItem> Search(string criteria, ErrorLog errorLog)
@stephengodbold
stephengodbold / ParseCsv.cs
Created February 20, 2013 23:31
Parse a CSV file with PowerShell in C#
using (var shell = PowerShell.Create(sessionState))
{
var parameters = new Dictionary<string, object>
{
{"Path", tempFilePath},
{"Delimiter", ','}
};
var command = shell.AddCommand("Import-Csv").AddParameters(parameters);
var results = command.Invoke();
@stephengodbold
stephengodbold / Install-TFSBuildMonitor.ps1
Created January 25, 2013 03:14
Installs TFS Build Monitor
param(
[parameter(mandatory=$true)]
[string]
$repositoryRoot,
[parameter()]
[string]
$installRoot = $env:ProgramFiles
)
#requires -Version 2.0
param(
[Parameter(Mandatory=$true)]
[string]
$databaseRootDirectory
)
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version 'Latest'
$fileGroupSpecification = "ON [PRIMARY]"
#requires -Version 2.0
param(
[Parameter(Mandatory=$true)]
[string]
$databaseRootDirectory
)
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version 'Latest'
$fileGroupSpecification = "ON [PRIMARY]"
@stephengodbold
stephengodbold / merge-local-branches.ps1
Created July 23, 2012 06:35 — forked from aaronpowell/.gitconfig
Script to cleanup merged branches locally
function Cleanup-GitBranches()
{
$branches = git branch --merged | ?{$_ -notmatch "\* master"} | ?{$_ -notmatch "master"} | ?{$_ -notmatch "\* *"} | %{$_.Trim() }
if (-not $branches) {
Write-Host "No merged branches detected"
return
}
Write-Host $branches