Skip to content

Instantly share code, notes, and snippets.

View grenade's full-sized avatar

rob thijssen grenade

View GitHub Profile
@grenade
grenade / set-version.ps1
Last active August 29, 2015 13:56
Sets the AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion using build, revision and NuGet publish history.
<#
.Synopsis
Determines the AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion using build, revision and NuGet publish history.
.Parameter baseDir
The root directory from which to recursively search for AssemblyInfo files
When called from TeamCity, use: "%teamcity.build.checkoutDir%" or omit.
Defaults to the parent directory of the script.
.Parameter nugetExe
The full path to NuGet.exe
When called from TeamCity, use: "%teamcity.tool.NuGet.CommandLine.DEFAULT.nupkg%\tools\NuGet.exe"
@grenade
grenade / kill-service.cmd
Last active August 29, 2015 13:57
Kill a service process that is hung in the stopping or starting state.
taskkill /F /FI "SERVICES eq DevOps.Dashboard.Bot"
New-EventLog -LogName DevOps.Dashboard -Source DevOps.Dashboard.Bot
Write-EventLog -LogName DevOps.Dashboard -Source DevOps.Dashboard.Bot -EntryType Information -Message "Bot starting..." -EventId 1
Write-EventLog -LogName DevOps.Dashboard -Source DevOps.Dashboard.Bot -EntryType Error -Message "DummyException: Something strange occurred somewhere, sometime." -EventId 2
@grenade
grenade / enable-file-sharing.cmd
Last active March 19, 2018 19:43
create a new vm on hyper-v
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
<#
.Synopsis
- Create an AD group to manage adding and removing computers to or from a domain under a specific AD scope.
- Add user accounts to the new group.
.Link
http://serverfault.com/a/146436/9144
.Link
http://technet.microsoft.com/en-us/library/ee617210.aspx
.Link
http://damianflynn.com/2011/08/23/ad-delegating-control-in-powershell/
@grenade
grenade / metmon.cs
Last active January 30, 2024 11:00
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using Newtonsoft.Json;
namespace metmon
{
class Program
{
tf workspaces /owner:%USERDOMAIN%\%USERNAME%
tf workspace /delete <workspace_name>;%USERDOMAIN%\%USERNAME%
tf workspaces /owner:%USERDOMAIN%\%USERNAME%
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Net;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.Framework.Client;
using Microsoft.TeamFoundation.Framework.Common;
using Microsoft.TeamFoundation.Server;
using Microsoft.TeamFoundation.VersionControl.Client;
git config --global url."[email protected]:".insteadOf git://github.com/