diff --git a/install/README.md b/install/README.md index 6a7ff21a..b2094da1 100644 --- a/install/README.md +++ b/install/README.md @@ -3,12 +3,17 @@ ## Install Dapr CLI ### Windows + ``` powershell -Command "iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1 | iex" ``` -### Linux/MacOS +Note: Until the repo is public, please use the below command. ``` -/usr/bin/bash "$(curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh)" -``` \ No newline at end of file +powershell -Command "$Env:GITHUB_USER='your_github_id'; $Env:GITHUB_TOKEN='your_github_pat_token'; iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1?token=AC2QIRCKXC5TWOYUZLHFMWC5VJ6FI | iex" +``` + +### Linux/MacOS + +WIP. \ No newline at end of file diff --git a/install/install.ps1 b/install/install.ps1 index 0091deab..eb8c18d9 100644 --- a/install/install.ps1 +++ b/install/install.ps1 @@ -1,8 +1,3 @@ - param ( - [string]$GitHubUsername = "", - [string]$GitHubToken = "" - ) - $ErrorActionPreference = 'stop' # Constants @@ -10,11 +5,12 @@ $DaprRoot="c:\dapr" $DaprRuntimeFileName = "dapr.exe" $DaprRuntimePath = "$DaprRoot\$DaprRuntimeFileName" -if ($GitHubUsername -eq "") { - $githubHeader = @{} +# Set Github request authentication for basic authentication. +if ($Env:GITHUB_USER) { + $basicAuth = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($Env:GITHUB_USER + ":" + $Env:GITHUB_TOKEN)); + $githubHeader = @{"Authorization"="Basic $basicAuth"} } else { - $basic = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($GitHubUsername + ":" + $GitHubToken)); - $githubHeader = @{"Authorization"="Basic $basic"} + $githubHeader = @{} } if((Get-ExecutionPolicy) -gt 'RemoteSigned' -or (Get-ExecutionPolicy) -eq 'ByPass') {