Skip to content

Instantly share code, notes, and snippets.

@RichieBzzzt
Created February 27, 2018 09:12
Show Gist options
  • Save RichieBzzzt/c88b1a35374e9a845b37687bfdba24ff to your computer and use it in GitHub Desktop.
Save RichieBzzzt/c88b1a35374e9a845b37687bfdba24ff to your computer and use it in GitHub Desktop.
#azfun init MyFunctionProj
if ((Test-Path "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.0") -eq $false) {
Write-Host "No Net Core 2.0 SDK installed. Installing..."
$NetCore = "C:\Users\richardlee\Downloads\dotnet-sdk-2.0.0-win-x64.exe"
$NetCoreArgs = {/install /quiet /norestart}
$process = Start-Process -Verb RunAs -Filepath $NetCore -ArgumentList $NetCoreArgs -Wait -PassThru
Write-Host "Exit code: $($process.ExitCode)"
if ($process.ExitCode -ne 0 ){
Write-Error "Oh dear!"
Throw
}
}
else {
Write-Host ".Net Core 2.0 Installed..."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment