mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-13 13:26:48 +00:00
21 lines
687 B
PowerShell
21 lines
687 B
PowerShell
################################################################################
|
|
## File: Install-Ruby.ps1
|
|
## Desc: Install Ruby for Windows
|
|
################################################################################
|
|
|
|
Import-Module -Name ImageHelpers
|
|
|
|
# Ruby versions are already available in the tool cache.
|
|
|
|
# Tool cache Ruby Path
|
|
$toolcacheRubyPath = 'C:\hostedtoolcache\windows\Ruby\2.5.*'
|
|
|
|
# Get Latest Ruby 2.5.x
|
|
$latestRubyBinPath2_5 = Get-ChildItem -Path $toolcacheRubyPath | Sort-Object {[System.Version]$_.Name} | Select-Object -Last 1 | ForEach-Object {
|
|
Join-Path $_.FullName 'x64\bin'
|
|
}
|
|
|
|
Add-MachinePathItem $latestRubyBinPath2_5
|
|
$env:Path = Get-MachinePath
|
|
exit 0
|