Skip to content

Commit

Permalink
Added version override for automated install (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
rgryta authored Mar 3, 2023
1 parent 3a69c49 commit 0fdf4ea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ WSL-Alpine-Install [-Interactive] [-DistroAlias <alias>] [-InstallPath <path>]

### WSL-Ubuntu-Install

Deploys clean Ubuntu Linux distro into WSL. Usage is the same to WSL-Alpine-Install. Currently takes lunar as default.
Deploys clean Ubuntu Linux distro into WSL. Usage is the same to WSL-Alpine-Install. Currently takes lunar as default. If you want to override default version, then specify -Version with lowercase release, e.g. `-Version kinetic`.
```powershell
WSL-Ubuntu-Install [-Interactive] [-DistroAlias <alias>] [-InstallPath <path>]
WSL-Ubuntu-Install [-Interactive] [-DistroAlias <alias>] [-InstallPath <path>] [-Version <release>]
```

### WSL-Debian-Install
Expand Down
6 changes: 5 additions & 1 deletion WSLTools/Public/WSL-Ubuntu-Install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ function WSL-Ubuntu-Install
Param(
[switch]$Interactive = $false,
[Parameter(Mandatory = $true)] [String]$DistroAlias,
[String]$Version,
[String]$InstallPath
)
try {
Expand Down Expand Up @@ -72,7 +73,10 @@ function WSL-Ubuntu-Install
}
# Get latest
if (-not $Interactive) {
$selected = $parsed_versions | Select-String -Pattern 'dist-lunar.*' | Select-Object -Index 0
if (-not($PSBoundParameters.ContainsKey('Version'))) {
$Version = "lunar"
}
$selected = $parsed_versions | Select-String -Pattern "dist-$Version.*" | Select-Object -Index 0
}
$selected = "?h=$selected"
Do {
Expand Down
2 changes: 1 addition & 1 deletion WSLTools/WSLTools.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'WSLTools.psm1'

# Version number of this module.
ModuleVersion = '1.3.1'
ModuleVersion = '1.3.2'

# Supported PSEditions
CompatiblePSEditions = 'Desktop', 'Core'
Expand Down

0 comments on commit 0fdf4ea

Please sign in to comment.