dotnet-installer/scripts/dev-dotnet.ps1
John Beisner b48b7d2ea0 .NET Core 2+ Naming and Versioning
New file name structure for the runtime and the CLI
per: https://github.com/dotnet/designs/issues/2

The renaming of assets, therefore the dotnet installation scripts must change to accommodate.

Trivial:
"Write-Host" should be "Write-Output"
2017-05-26 15:46:56 -07:00

24 lines
814 B
PowerShell

#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
$oldPath = $env:PATH
try {
# Put the stage2 output on the front of the path
if(!(Get-Command dotnet -ErrorAction SilentlyContinue)) {
throw "You need to have a version of 'dotnet' on your path so we can determine the RID"
}
$rid = dotnet --version | where { $_ -match "^ Runtime Id:\s*(.*)$" } | foreach { $matches[1] }
$stage2 = "$PSScriptRoot\..\artifacts\$rid\stage2\bin"
if (Test-Path $stage2) {
$env:PATH="$stage2;$env:PATH"
} else {
Write-Output "You don't have a dev build in the 'artifacts\$rid\stage2' folder!"
}
dotnet @args
} finally {
$env:PATH = $oldPath
}