Created
May 23, 2020 08:23
-
-
Save MertSenel/1bf3b01ecbddd9b9966a7663603a1dab to your computer and use it in GitHub Desktop.
Generate a feature branch name that takes AzureDevOps Work Item Version and Title Format as arguements and optionally your the developer's initials
This file contains 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 New-FeatureBranchName { | |
[CmdletBinding()] | |
param ( | |
# Work Item ID | |
[Parameter(Mandatory)][Alias('i','id')][string]$workItemId, | |
# Work Item Title | |
[Parameter(Mandatory)][Alias('t','title')][string]$workItemTitle, | |
# Initials | |
[Parameter()][Alias('in','name', 'inits')][string]$initials | |
) | |
$featureprefix = "feature/" | |
if($initials) {$featureprefix = $featureprefix + $initials + '/'} | |
$TitleFormatted = $workItemTitle -replace " ", "_" | |
$branchname = $featureprefix + $workItemId + '_' + $TitleFormatted | |
return $branchname | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment