Skip to content

Instantly share code, notes, and snippets.

@stknohg
Created August 21, 2019 05:46
Show Gist options
  • Select an option

  • Save stknohg/a37f54751f2fcdb1a43c2c8456f2ef76 to your computer and use it in GitHub Desktop.

Select an option

Save stknohg/a37f54751f2fcdb1a43c2c8456f2ef76 to your computer and use it in GitHub Desktop.
最新バージョンの.NET Core SDKをインストーラーからインストールするスクリプト (x64)
#
# 最新バージョンの.NET Core SDKをインストーラーからインストールするスクリプト
# ※1 インストーラーのインストールは要管理者権限です
# ※2 Zipファイルからの展開は公式の dotnet-install.ps1 を使いましょう
# https://docs.microsoft.com/ja-jp/dotnet/core/tools/dotnet-install-script
#
# 現在最新の.NET Core SDKのバージョンを取得
$commitHash, $version = -split (Invoke-RestMethod -Uri https://dotnetcli.azureedge.net/dotnet/Sdk/Current/latest.version)
# MSIインストーラーをダウンロードしてサイレントインストール
$msiPath = Join-Path $env:TEMP "dotnet-sdk-$version-win-x64.exe"
Invoke-WebRequest -Uri "https://dotnetcli.azureedge.net/dotnet/Sdk/$version/dotnet-sdk-$version-win-x64.exe" -OutFile $msiPath
& $msiPath /install /passive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment