Skip to content

Instantly share code, notes, and snippets.

View stephengodbold's full-sized avatar

Steve Godbold stephengodbold

View GitHub Profile
@stephengodbold
stephengodbold / killscc.ps1
Last active September 25, 2015 18:48 — forked from jstangroome/killscc.ps1
Removes source control bindings, and optionally backs up the original files
#requires -version 2.0
param (
[ValidateScript({$_ | Test-Path -PathType Container})]
[Parameter(Mandatory=$true)]
[string] $folder,
[switch] $backup
)
function killScc(){
gci -path $folder -i *.vssscc,*.vspscc -recurse | Remove-Item -force -verbose
@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
#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 / Install-TFSBuildMonitor.ps1
Created January 25, 2013 03:14
Installs TFS Build Monitor
param(
[parameter(mandatory=$true)]
[string]
$repositoryRoot,
[parameter()]
[string]
$installRoot = $env:ProgramFiles
)
@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();
public class SearchHub
{
private readonly IEnumerable<IRepository> repositories;
public SearchHub(IEnumerable<IRepository> repositories)
{
this.repositories = repositories;
}
public IEnumerable<WorkItem> Search(string criteria, ErrorLog errorLog)
param(
[parameter()]
[string]
$repositoryRoot,
[parameter()]
[string]
$installRoot = $env:ProgramFiles
)
@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';
}
@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",