Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save viktors-telle/b3ab6820d1317df9ffea692d0338e6f8 to your computer and use it in GitHub Desktop.
Save viktors-telle/b3ab6820d1317df9ffea692d0338e6f8 to your computer and use it in GitHub Desktop.
extension {
name = "InstallDotNet"
publisher = "Microsoft.Compute"
type = "CustomScriptExtension"
type_handler_version = "1.8"
auto_upgrade_minor_version = true
settings = <<EOF
{
"fileUris": [
"https://yourblobstorageaccount.blob.core.windows.net/dotnet48/InstallDotNet-48.ps1"
],
"commandToExecute": "powershell -ExecutionPolicy Unrestricted -File InstallDotNet-48.ps1 && powershell -NoProfile -ExecutionPolicy unrestricted -Command \"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Runtime dotnet -Channel 2.1 -InstallDir 'C:\\Program Files\\dotnet' \" && powershell -NoProfile -ExecutionPolicy unrestricted -Command \"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Runtime dotnet -Channel 3.1 -InstallDir 'C:\\Program Files\\dotnet' \""
}
EOF
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment