Skip to content

Instantly share code, notes, and snippets.

@capoferro
Created April 22, 2017 01:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capoferro/3e2418347039333ea4f91707e6e4dab7 to your computer and use it in GitHub Desktop.
Save capoferro/3e2418347039333ea4f91707e6e4dab7 to your computer and use it in GitHub Desktop.
$tempPath = Join-Path $env:TEMP "dnvminstall"
$dnvmPs1Path = Join-Path $tempPath "dnvm.ps1"
$dnvmCmdPath = Join-Path $tempPath "dnvm.cmd"
Write-Host "Using temporary directory: $tempPath"
if (!(Test-Path $tempPath)) { md $tempPath | Out-Null }
$webClient = New-Object System.Net.WebClient
$webClient.Proxy = [System.Net.WebRequest]::DefaultWebProxy
$webClient.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
Write-Host "Downloading DNVM.ps1 to $dnvmPs1Path"
$webClient.DownloadFile('https://raw.githubusercontent.com/aspnet/Home/b77ee2c7d112d3c151d7546c1f8a094b6cb798d6/dnvm.ps1', $dnvmPs1Path)
Write-Host "Downloading DNVM.cmd to $dnvmCmdPath"
$webClient.DownloadFile('https://raw.githubusercontent.com/aspnet/Home/b77ee2c7d112d3c151d7546c1f8a094b6cb798d6/dnvm.cmd', $dnvmCmdPath)
Write-Host "Installing DNVM"
& $dnvmCmdPath setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment