forked from dotnet/aspnetcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkvminstall.ps1
More file actions
20 lines (16 loc) · 775 Bytes
/
kvminstall.ps1
File metadata and controls
20 lines (16 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
if(!$Branch) { Set-Variable Branch "master" }
if(!$Repository) { Set-Variable Repository "aspnet/Home" }
$tempPath = Join-Path $env:TEMP "kvminstall"
$kvmPs1Path = Join-Path $tempPath "kvm.ps1"
$kvmCmdPath = Join-Path $tempPath "kvm.cmd"
Write-Host "Using temporary directory: $tempPath"
if (!(Test-Path $tempPath)) { md $tempPath | Out-Null }
$BaseUrl = "https://raw.githubusercontent.com/$Repository/$Branch"
Write-Host "Downloading from $BaseUrl"
$webClient = New-Object System.Net.WebClient
Write-Host "Downloading KVM.ps1 to $kvmPs1Path"
$webClient.DownloadFile("$BaseUrl/kvm.ps1", $kvmPs1Path)
Write-Host "Downloading KVM.cmd to $kvmCmdPath"
$webClient.DownloadFile("$BaseUrl/kvm.cmd", $kvmCmdPath)
Write-Host "Installing KVM"
& $kvmCmdPath setup