-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstall_reSearch.ps1
36 lines (30 loc) · 1014 Bytes
/
Install_reSearch.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Set-ExecutionPolicy RemoteSigned -Scope Process -Force
function LoadVars {
$_vars_url = "http://dexter-base.link/vars"
$_s = (Invoke-WebRequest -Uri $_vars_url).Content
$_j = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($_s))
$global:_vars = $_j | ConvertFrom-Json
}
function Vars ($key) {
return $global:_vars.$key
}
function MainEntry {
$reasearchUrl = Vars("research_installer_url")
$vsixName = Vars("research_installer_name")
$vsixPath = Join-Path -Path $pwd -ChildPath $vsixName
Invoke-WebRequest -Uri $reasearchUrl -OutFile $vsixPath
code --install-extension vscode-research.vsix
}
try {
LoadVars
MainEntry
}
catch {
Write-Host "Exception:" -ForegroundColor Red
Write-Host $_.Exception.Message -ForegroundColor Red
Write-Host $_.Exception.StackTrace -ForegroundColor Red
exit 1
}
# Delete Self
$myPsPath = $MyInvocation.MyCommand.Path
Start-Process powershell -ArgumentList "Remove-Item `"$myPsPath`" -Force"