File size: 1,091 Bytes
de01b62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
If Not WScript.Arguments.Named.Exists("elevate") Then
  CreateObject("Shell.Application").ShellExecute WScript.FullName, """" & WScript.ScriptFullName & """ /elevate", "", "runas", 10
  WScript.Quit
End If

Set oShell = CreateObject("WScript.Shell")
Set oEnvSystem = oShell.Environment("SYSTEM")
Set oFS = CreateObject("Scripting.FileSystemObject")

MsgBox "It may take a few seconds to execute this script." & vbCrLf & vbCrLf & "Click 'OK' button and wait for the prompt of 'Done.' to pop up!"

Dim baseUrl
baseUrl = "http://127.0.0.1:8181"

Sub RemoveEnv(env)
    On Error Resume Next

    env.Remove("AGENT_DEBUG_OVERRIDE_PROXY_URL")
    env.Remove("GITHUB_COPILOT_OVERRIDE_PROXY_URL")
    env.Remove("AGENT_DEBUG_OVERRIDE_CAPI_URL")
    env.Remove("GITHUB_COPILOT_OVERRIDE_CAPI_URL")
End Sub

RemoveEnv oShell.Environment("USER")

oEnvSystem("AGENT_DEBUG_OVERRIDE_PROXY_URL") = baseUrl
oEnvSystem("GITHUB_COPILOT_OVERRIDE_PROXY_URL") = baseUrl
oEnvSystem("AGENT_DEBUG_OVERRIDE_CAPI_URL") = baseUrl & "/v1"
oEnvSystem("GITHUB_COPILOT_OVERRIDE_CAPI_URL") = baseUrl & "/v1"

MsgBox "Done."