Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
task GetBuildNumber {
$version = gc $base_directory\$solution_name\Properties\AssemblyInfo.cs | select-string -pattern "AssemblyVersion"
$version -match '^\[assembly: AssemblyVersion\(\"(?<major>[0-9]+)\.(?<minor>[0-9]+)\.(?<revision>[0-9]+)\.(?<build>[0-9]+)\"\)\]' | Out-Null
"##teamcity[buildNumber '{0}.{1}.{2}.{3}']" -f $matches["major"],$matches["minor"],$matches["revision"],$matches["build"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.