-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathInstall-Ruby.ps1
More file actions
40 lines (33 loc) · 988 Bytes
/
Install-Ruby.ps1
File metadata and controls
40 lines (33 loc) · 988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the
# AUTHORS file for details. All rights reserved. Use of this source code is
# governed by a BSD-style license that can be found in the LICENSE file.
<#
.Synopsis
Installs Ruby.
.Description
Downloads the specified release of Ruby and installs it silently on the host.
.Parameter Version
The version of Ruby to install.
.Parameter InstallationPath
The location to install to.
.Example
# Install 2.4.2-2
Install-Ruby -Version 2.4.2-2
#>
function Install-Ruby {
param(
[Parameter(Mandatory)]
[string]$version,
[Parameter()]
[AllowNull()]
[string]$installationPath
)
$packageParameters = @();
if ($installationPath) {
$packageParameters += ('/InstallDir:"{0}"' -f $installationPath);
}
Install-FromChoco `
-Name 'ruby' `
-Version $version `
-PackageParameters $packageParameters;
}