Skip to content

Commit 9bf63bc

Browse files
authored
ci(jenkins): install python3 for the given VERSION (#730)
1 parent e845971 commit 9bf63bc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/install-python.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Abort with non zero exit code on errors
2+
$ErrorActionPreference = "Stop"
3+
4+
Write-Host("Getting latest Python3 version for {0} ..." -f $env:VERSION)
5+
& choco list python3 --exact --by-id-only --all | Select-String -Pattern "python3 $env:VERSION"
6+
$Version = $(choco list python3 --exact --by-id-only --all) | Select-String -Pattern "python3 $env:VERSION" | %{$_.ToString().split(" ")[1]} | sort | Select-Object -Last 1
7+
8+
Write-Host("Installing Python3 {0} ..." -f $Version)
9+
& choco install python3 --no-progress -y --version "$Version"

0 commit comments

Comments
 (0)