mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 12:48:18 +00:00
Get repository up to speed.
This commit is contained in:
29
images/win/scripts/Installers/Windows2016/Install-Python.ps1
Normal file
29
images/win/scripts/Installers/Windows2016/Install-Python.ps1
Normal file
@@ -0,0 +1,29 @@
|
||||
################################################################################
|
||||
## File: Install-Python.ps1
|
||||
## Team: CI-X
|
||||
## Desc: Configure python on path with 3.6.* version from the tools cache
|
||||
## Must run after tools cache is setup
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$python36path = $Env:AGENT_TOOLSDIRECTORY + '/Python/3.6*/x64'
|
||||
$pythonDir = Get-Item -Path $python36path
|
||||
|
||||
if($pythonDir -is [array])
|
||||
{
|
||||
Write-Host "More than one python 3.6.* installations found"
|
||||
Write-Host $pythonDir
|
||||
exit 1
|
||||
}
|
||||
|
||||
$currentPath = Get-MachinePath
|
||||
|
||||
if ($currentPath | Select-String -SimpleMatch $pythonDir.FullName)
|
||||
{
|
||||
Write-Host $pythonDir.FullName ' is already in PATH'
|
||||
exit 0
|
||||
}
|
||||
|
||||
Add-MachinePathItem -PathItem $pythonDir.FullName
|
||||
Add-MachinePathItem -PathItem "$($pythonDir.FullName)\Scripts"
|
||||
Reference in New Issue
Block a user