Skip to content

Instantly share code, notes, and snippets.

jernejg

Block or report user

Report or block jernejg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jernejg
jernejg / TeamCityPendingChanges.ps1
Created Sep 15, 2017
Powershell script that queries TeamCity for pending changes and generates a html release file with author, number of files changed, git comment and urls to matched Jira issues.
View TeamCityPendingChanges.ps1
param(
[string]$TC, #%teamcity.serverUrl%
[string]$TC_build_Id, #system.teamcity.buildType.id
[string]$outputFileName) #Output file name
$TC += "/guestAuth" #TeamCity needs to be running with the guest account enabled.
$url = "$($TC)/app/rest/changes?locator=buildType:(id:$($TC_build_Id)),pending:true" #Get pending changes for a build configuration
$JiraUrl = "http://yourjiraurl.com/"
function GetChangeDetailsUrl($changesXml)
View pretxncommit_messagebox.ps1
[system.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms");
function Get-HgAddedLargeFile
{
process
{
return ForEach-Object {$_.Insert(1,",").Remove(2,1)} `
| ConvertFrom-Csv -Header Status,Path `
| Where-Object {$_.Status -ieq "A"} `
| Get-Item `
@jernejg
jernejg / pretxncommit.ps1
Last active Dec 26, 2015
Prevent large file commits with PowerShell and Mercurial hooks
View pretxncommit.ps1
function Get-HgAddedLargeFile
{
process
{
return ForEach-Object {$_.Insert(1,",").Remove(2,1)} `
| ConvertFrom-Csv -Header Status,Path `
| Where-Object {$_.Status -ieq "A"} `
| Get-Item `
| Where-Object {$_.Length -gt 1MB}
}
You can’t perform that action at this time.