Skip to content

Commit d711a2b

Browse files
authored
Create install-dotnet-windows.ps1
1 parent ca8c8e0 commit d711a2b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
param (
2+
[string]$Version,
3+
[string]$Arch
4+
)
5+
6+
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1
7+
./dotnet-install.ps1 -Architecture $Arch -Channel $Version
8+
9+
if ($Env:DOTNET_INSTALL_DIR) {
10+
$dotnetRoot = $Env:DOTNET_INSTALL_DIR
11+
} else {
12+
$dotnetRoot = Join-Path $Env:LOCALAPPDATA "Microsoft\dotnet"
13+
}
14+
15+
$dotnetRoot >> $Env:GITHUB_PATH
16+
"DONET_ROOT=$dotnetRoot" >> $Env:GITHUB_ENV

0 commit comments

Comments
 (0)