-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated CLI installation script #69
Conversation
if ((Get-ExecutionPolicy) -gt 'RemoteSigned' -or (Get-ExecutionPolicy) -eq 'ByPass') { | ||
Write-Output "PowerShell requires an execution policy of 'RemoteSigned'." | ||
Write-Output "To make this change please run:" | ||
Write-Output "'Set-ExecutionPolicy RemoteSigned -scope CurrentUser'" |
Check warning
Code scanning / devskim
The Set-ExecutionPolicy cmdlet has been used to dynamically change the permissions available to PowerShell. Warning
} | ||
|
||
# Change security protocol to support TLS 1.2 / 1.1 / 1.0 - old powershell uses TLS 1.0 as a default protocol | ||
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls" |
Check notice
Code scanning / devskim
Generic: Hard-coded SSL/TLS Protocol Note
} | ||
|
||
# Change security protocol to support TLS 1.2 / 1.1 / 1.0 - old powershell uses TLS 1.0 as a default protocol | ||
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls" |
Check notice
Code scanning / devskim
Generic: Hard-coded SSL/TLS Protocol Note
@@ -0,0 +1,150 @@ | |||
param ( | |||
[string]$Version, | |||
[string]$DrasiRoot = "$env:LOCALAPPDATA\drasi" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Makefile install puts it in $env:ProgramFiles\drasi
cli/installers/install-drasi-cli.ps1
Outdated
$release = $Releases | Where-Object { $_.tag_name -notlike "*rc*" } | Select-Object -First 1 | ||
} | ||
else { | ||
$release = $Releases | Where-Object { $_.tag_name -eq "v$Version" } | Select-Object -First 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this always return the latest release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think the github api lists releases with the most recent release at the top. This will fetch the first (most recent) release
cli/installers/install-drasi-cli.ps1
Outdated
} | ||
|
||
# Version string | ||
Write-Output "drasi CLI version: $(&$DrasiCliFilePath version -o json | ConvertFrom-JSON | Select-Object -ExpandProperty version)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this works drasi?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right. Maybe we can just output the release tag/version that was used in the download
Description
Updated the CLI installation script to download from Github instead of Azure storage blob
also enabled the ability to download a specific version
TODO:
test with windows (will do this after I get back home today so that I can use my windows machine 😄 )
test in dev container
Type of change
Fixes: #issue_number