Skip to content

Instantly share code, notes, and snippets.

View JamesWoolfenden's full-sized avatar
💭
plans, lots of plans

James Woolfenden JamesWoolfenden

💭
plans, lots of plans
View GitHub Profile
@JamesWoolfenden
JamesWoolfenden / TFSChangeset.msbuild
Created November 14, 2013 16:41
How to get the TFS changeset for a build.
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AssemblyFile>.\packages\MSBuild.Extension.Pack.1.3.0\tools\net40\MSBuild.ExtensionPack.TaskFactory.PowerShell.dll</AssemblyFile>
</PropertyGroup>
<UsingTask TaskFactory="PowershellTaskFactory" TaskName="Changeset" AssemblyFile="$(AssemblyFile)">
<ParameterGroup>
<changeset Output="true" />
</ParameterGroup>
<Task>
@JamesWoolfenden
JamesWoolfenden / posh-build
Last active November 19, 2018 09:52
Powershell build functions, direct call to msbuild API.
[void][System.Reflection.Assembly]::Load('Microsoft.Build.Engine, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
[void][System.Reflection.Assembly]::Load('Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
[void][System.Reflection.Assembly]::Load('mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
function make()
{
<#
.SYNOPSIS
Builds all files according to a naming strategy found in the given or current path
@JamesWoolfenden
JamesWoolfenden / MSBuild.ExtensionPack.VersionNumber.targets
Last active August 29, 2015 14:02
Alternate Teamcity friendly auto targets file for the the msbuild extension pack
<?xml version="1.0" encoding="utf-8"?>
<!--
This task is based on the AssemblyInfo task written by Neil Enns (http://code.msdn.microsoft.com/AssemblyInfoTaskvers). It is used here with permission.
This targets file includes all the necessary information to automatically increment build numbers as part of
a regular build process. To use it simply include it in your project file after any other includes. The typical
include line looks like this:
<Import Project="$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.VersionNumber.targets"/>
-->
@JamesWoolfenden
JamesWoolfenden / gist:69bb62df3ba9cb03d112
Created July 8, 2015 12:59
Calling Teamcity builds from Powershell
function Get-TeamcityBuildStatus
{
<#
.SYNOPSIS
get status of build from Teamcity server
.EXAMPLE
Get-TeamcityBuildStatus -server servername -port 81 -buildID 12 -user timmy -password time
@JamesWoolfenden
JamesWoolfenden / check-gists.ps1
Last active February 23, 2016 16:52
checks for new gists from a github user
param(
[string]$user="andrewh")
function show-recentgists
{
param(
[string]$user,
[int]$count)
$url ="https://api.github.com/users/$user/gists"
@JamesWoolfenden
JamesWoolfenden / SetAdvancedLogging.ps1
Created May 18, 2016 13:25
Setup advanced logging for IIS thru AWS
Import-Module WebAdministration
$LoggingMSI="AdvancedLogging64.msi"
$uri='https://download.microsoft.com/download/9/6/5/96594C39-9918-466C-AFE0-920737351987/AdvancedLogging64.msi'
invoke-webrequest -uri $uri -OutFile $LoggingMSI
Start-Process -FilePath msiexec.exe -ArgumentList /i, $LoggingMSI , /quiet -Wait
# Disables http logging module
Set-WebConfigurationProperty -Filter system.webServer/httpLogging -PSPath machine/webroot/apphost -Name dontlog -Value true
#this script assume your using dev and sets it too the prod aws cred
Param(
[Parameter(Mandatory=$true)]
[string]$awsprofile)
$exists="$(aws configure get aws_access_key_id --profile $awsprofile)"
if ($exists)
{
[Environment]::SetEnvironmentVariable("AWS_DEFAULT_PROFILE","$awsprofile","machine")
@JamesWoolfenden
JamesWoolfenden / Set-AWSAccountTerraform.ps1
Created June 21, 2016 09:13
Switches aws config for aws cli and terraform
#this script assume your using dev and sets it too the prod aws cred
Param(
[Parameter(Mandatory=$true)]
[string]$awsprofile)
$exists="$(aws configure get aws_access_key_id --profile $awsprofile)"
if ($exists)
{
[Environment]::SetEnvironmentVariable("AWS_DEFAULT_PROFILE","$awsprofile","machine")
param(
[Parameter(Mandatory=$true)]
[string]$subscriptionName,
[Parameter(Mandatory=$true)]
[string]$serviceName,
[string]$slot="Staging")
Write-Output "$(Get-Date) - Selecting $SubscriptionName"
Select-Azuresubscription -SubscriptionName $SubscriptionName
<?xml version="1.0" encoding="utf-8"?>
<DiagnosticsConfiguration xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<PublicConfig>
<WadCfg>
<DiagnosticMonitorConfiguration overallQuotaInMB="2048">
<DiagnosticInfrastructureLogs scheduledTransferLogLevelFilter="Error" />
<Directories scheduledTransferPeriod="PT1M">
<IISLogs containerName="wad-iis-logfiles" />
<FailedRequestLogs containerName="wad-failedrequestlogs" />
<DataSources>