Skip to content

Commit 303b8dd

Browse files
committed
provide a simple version helper script to interact with ES (#929)
1 parent 650f8bc commit 303b8dd

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tools/version-helper.ps1

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This file returns the version information to internal ES systems.
2+
3+
param (
4+
[ValidateSet("Major", "Minor", "Patch")]
5+
[Parameter(Mandatory=$true)]
6+
[string]$Version = ""
7+
)
8+
9+
Set-StrictMode -Version 'Latest'
10+
$ErrorActionPreference = 'Stop'
11+
12+
# Important paths.
13+
$RootDir = Split-Path $PSScriptRoot -Parent
14+
. $RootDir\tools\common.ps1
15+
16+
$XdpVersion = Get-XdpBuildVersion
17+
18+
switch ($Version) {
19+
"Major" { return $XdpVersion.Major }
20+
"Minor" { return $XdpVersion.Minor }
21+
"Patch" { return $XdpVersion.Patch }
22+
}

0 commit comments

Comments
 (0)