Last active
December 12, 2017 17:37
-
-
Save joncloud/6371db32c9fddf1bb0ffa0106ae5e6ca to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| $Prefix = Get-ChildItem -Recurse -Depth 2 -Filter *.csproj ` | |
| | ForEach-Object { [Xml]$A = $_ | Get-Content; $A.Project.PropertyGroup.VersionPrefix } ` | |
| | Where-Object { $_ -ne $null -and $_ -ne '' } ` | |
| | Select-Object -First 1 | |
| If ($IsBeta -eq "1") { | |
| $Parts = $BuildNumber.Split('.') | |
| $Date = $Parts[0] | |
| $Sequence = $Parts[1] / 1 | |
| $Suffix = "-beta" + $Date + $Sequence.ToString("000") | |
| } | |
| Else { | |
| $Suffix = "" | |
| } | |
| Write-Host "Using Package Version $Prefix$Suffix" | |
| Write-Host "##vso[task.setvariable variable=PackageVersion;]$Prefix$Suffix" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment