Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/dotnet-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ function Get-NormalizedChannel([string]$Channel) {
Say-Warning 'Using branch name with -Channel option is no longer supported with newer releases. Use -Quality option with a channel in X.Y format instead, such as "-Channel 5.0 -Quality Daily."'
}

if ($Channel -match '^\d+$') {
throw "'$Channel' is not a supported value for -Channel option. Supported values are: STS, LTS, a two-part version such as '10.0', or a three-part SDK feature band such as '10.0.1xx'. Did you mean '-Channel $Channel.0'? If you think this is a bug, report it at https://github.com/dotnet/install-scripts/issues."
}

switch ($Channel) {
{ $_ -eq "lts" } { return "LTS" }
{ $_ -eq "sts" } { return "STS" }
Expand Down
5 changes: 5 additions & 0 deletions src/dotnet-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,11 @@ get_normalized_channel() {
say_warning 'Using branch name with -Channel option is no longer supported with newer releases. Use -Quality option with a channel in X.Y format instead.';
fi

if [[ $channel =~ ^[0-9]+$ ]]; then
say_err "'$channel' is not a supported value for --channel option. Supported values are: STS, LTS, a two-part version such as '10.0', or a three-part SDK feature band such as '10.0.1xx'. Did you mean '-Channel $channel.0'? If you think this is a bug, report it at https://github.com/dotnet/install-scripts/issues."
return 1
fi

if [ ! -z "$channel" ]; then
case "$channel" in
lts)
Expand Down