Skip to content

Instantly share code, notes, and snippets.

View jstangroome's full-sized avatar

Jason Stangroome jstangroome

View GitHub Profile
#requires -Version 2
[CmdletBinding()]
param (
[parameter(
Mandatory=$true,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true
)]
[string[]]
@jstangroome
jstangroome / Export-TfsCollectionReports.ps1
Created July 22, 2010 03:14
Export-TfsCollectionReports
#requires -version 2.0
[CmdletBinding()]
param (
[parameter(Mandatory=$true)]
[ValidatePattern('^https?://')]
[string]
$TeamProjectCollectionUri,
[parameter(Mandatory=$true)]
[string]
#requires -version 2.0
[CmdletBinding()]
param (
[parameter(Mandatory=$true)]
[ValidateScript({ $_ | Test-Path -PathType Leaf })]
[string]
$Path
)
@jstangroome
jstangroome / Export-VMTemplate.ps1
Created August 3, 2010 12:05
Export-VMTemplate
#requires -version 2.0
param (
[parameter(Mandatory=$true)]
$VM,
[parameter(Mandatory=$true)]
[string]
$TemplateName,
@jstangroome
jstangroome / Microsoft.PowerShellISE_profile.ps1
Created August 11, 2010 07:40
Automatic TFS Checkout for PowerShell ISE
if ($global:ProfileEventSubscribers) {
$global:ProfileEventSubscribers |
ForEach-Object {
Unregister-Event -SourceIdentifier $_.Name
}
}
$global:ProfileEventSubscribers = @()
$global:IsTfsInstalled = $false
try {
@jstangroome
jstangroome / Import-PSISEProfile.ps1
Created August 11, 2010 14:58
Import-PSISEProfile.ps1
if ($psise) {
if (!(test-path $profile)) { new-item $profile -fo -it file }
$e = $psise.CurrentPowerShellTab.Files.Add($profile).Editor
$col = $e.GetLineLength($e.LineCount)+1
$e.Select($e.LineCount,$col,$e.LineCount,$col)
$e.InsertText("`n" + (new-object Net.WebClient).DownloadString(
'http://gist.github.com/raw/518638/3e0beb7a5a6ddc19446d5a6d38c8267794c92eba/Microsoft.PowerShellISE_profile.ps1'
))
} else { throw 'Run this script using the ISE' }
@jstangroome
jstangroome / ConvertTo-DbSchema1.0.ps1
Created August 16, 2010 23:26
ConvertTo-DbSchema1.0.ps1
#requires -version 2.0
[CmdletBinding()]
param (
[parameter(Mandatory=$true)]
[ValidateScript({Test-Path -PathType Leaf -LiteralPath $_})]
[string]
$DbSchemaFile,
[parameter(Mandatory=$true)]
[string]
@jstangroome
jstangroome / Grant-FileSystemAccess.ps1
Created August 20, 2010 04:45
Grant-FileSystemAccess
function Grant-FileSystemAccess (
[string]$Path,
[string]$UserName,
[System.Security.AccessControl.FileSystemRights]$Rights
) {
$Inherit = [System.Security.AccessControl.InheritanceFlags]'None'
$Propagation = [System.Security.AccessControl.PropagationFlags]'None'
if ((Get-Item -Path $Path).PSIsContainer) {
$Inherit = [System.Security.AccessControl.InheritanceFlags]'ContainerInherit, ObjectInherit'
}
@jstangroome
jstangroome / Get-VSSolutionReferences.ps1
Created August 30, 2010 09:34
Get-VSSolutionReferences.ps1
#requires -version 2.0
[CmdletBinding()]
param (
[parameter(Mandatory=$true)]
[ValidateScript({ Test-Path -Path $_ -PathType Leaf })]
[string]
$Path
)
$ErrorActionPreference = 'Stop'
@jstangroome
jstangroome / Build.csproj
Created August 31, 2010 00:44
References for TFS 2010 build process templates
<Reference Include="Microsoft.TeamFoundation.Build.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.Build.Workflow, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(MSBuildProgramFiles32)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Build.Workflow.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TeamFoundation.TestImpact.BuildIntegration">
<HintPath>$(MSBuildProgramFiles32)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.TestImpact.BuildIntegration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TeamFoundation.TestImpact.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.V