$tag = git describe --always --tags "--abbrev=0" --exclude latest $revision = git describe --always --tags --exclude latest $text = @" // This file is generated by update-version.ps1 using System.Reflection; [assembly: AssemblyVersion("$tag")] [assembly: AssemblyInformationalVersion("$revision")] "@ $text | Out-File $PSScriptRoot\..\GitVersion.cs -Encoding utf8