This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MyHttpWebRequest : HttpWebRequest | |
| { | |
| private static readonly IFormatterConverter Converter = new FormatterConverter(); | |
| private static readonly StreamingContext Context = new StreamingContext(StreamingContextStates.Clone); | |
| public MyHttpWebRequest(string url) | |
| : this(new Uri(url)) | |
| { | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Load some types initially so the cmdlets work | |
| Add-TFSApiAssembly | |
| # Create a TFS TeamProjectCollection and extend it with some common service properties for easy access | |
| $tfs = Get-Tfs -Uri https://tfs.somedomain.com/tfs/ProjectCollection -Services BS, VCS, TM -Verbose | |
| # You can write cmdlets or you can use the built in API and add your own extensions | |
| $buildDefinitions = Get-TfsBuildDefinition -Tfs $tfs -TeamProject MyProject | |
| # $buildDefinitions = $tfs.BS.QueryBuildDefinitions('MyProject') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Add-GitIgnoreForVS ([switch]$DisableNugetRestore,[switch]$PassThru) { | |
| $cmdArgs = @{ | |
| Name="VisualStudio" | |
| PassThru=$PassThru | |
| Uncomment=( & {if($DisableNugetRestore) { @() } else { @("packages/") } }) | |
| } | |
| Add-GitIgnore @cmdArgs | |
| } | |
| function Add-GitIgnore ([string]$Name, [switch]$PassThru, [string]$UserRepo="github/gitignore", [string]$Branch="master", [string[]]$Uncomment) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!--?xml version="1.0" encoding="utf-8"?--> | |
| <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
| <UsingTask | |
| TaskName="LogItems" | |
| TaskFactory="CodeTaskFactory" | |
| AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" > | |
| <ParameterGroup> | |
| <Items Required="true" ParameterType="Microsoft.Build.Framework.ITaskItem[]" /> | |
| <Metadata ParameterType="Microsoft.Build.Framework.ITaskItem[]" /> | |
| <Importance /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Reflection; | |
| using System.Security.Policy; | |
| namespace MsBuild.AssemblyFu | |
| { | |
| internal interface IAssemblyAttributeGetter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Start-LocalDb { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory,ValueFromPipeLine,Position=1)] | |
| [psobject[]]$Instance, | |
| [string]$ToolPath = (Find-LocalDbExe) | |
| ) | |
| begin { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Uninstall-AppFabricCacheNode { | |
| #TODO: Should try and remove the configuration stuff | |
| gwmi win32_product -filter "Name LIKE 'AppFabric%'" |% { | |
| $key="IdentifyingNumber=`"$($_.IdentifyingNumber)`",Name=`"$($_.Name)`",version=`"$($_.Version)`""; | |
| ([wmi]"Win32_Product.$key").uninstall() | |
| } | |
| } | |
| function Reset-AppFabricCacheDatabase { | |
| param( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-ArchiveItems { | |
| param([Parameter(Mandatory)][string]$Archive) | |
| function recurse-items { | |
| param([object]$items) | |
| foreach($item in $items) { | |
| $item | |
| $folder = $item.GetFolder | |
| if ($folder) { | |
| recurse-items $folder.Items() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function Where-ObjectMatches() { | |
| [CmdletBinding(DefaultParameterSetName="MatchLike")] | |
| Param( | |
| [Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] | |
| [Alias("Value", "Input", "Object", "io")] | |
| [psobject[]]$InputObject, | |
| [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,Position=1)] | |
| [Alias("Selector")] | |
| [psobject]$Property, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function PSAddMember() { | |
| $this = $args[0] | |
| switch($args.Count) { | |
| 2 { | |
| ($args[1] -as [HashTable]) | %{ $_.GetEnumerator() } | %{ Add-Member -InputObject $this -Name $_.Name -value $_.Value -MemberType Noteproperty -Force -PassThru } | |
| break; | |
| } | |
| 3 { |