-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathscoop-config.ps1
More file actions
54 lines (48 loc) · 1.46 KB
/
scoop-config.ps1
File metadata and controls
54 lines (48 loc) · 1.46 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Usage: scoop config [rm] name [value]
# Summary: Get or set configuration values
# Help: The scoop configuration file is saved at ~/.config/scoop/config.json.
#
# To get a configuration setting:
#
# scoop config <name>
#
# To set a configuration setting:
#
# scoop config <name> <value>
#
# To remove a configuration setting:
#
# scoop config rm <name>
#
# Settings
# --------
#
# proxy: [username:password@]host:port
# no_proxy: host
#
# By default, Scoop will use the proxy settings from Internet Options, but with anonymous authentication.
#
# * To use the credentials for the current logged-in user, use 'currentuser' in place of username:password
# * To use the system proxy settings configured in Internet Options, use 'default' in place of host:port
# * An empty or unset value for proxy is equivalent to 'default' (with no username or password)
# * To bypass the system proxy and connect directly, use 'none' (with no username or password)
param($name, $value)
. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\help.ps1"
reset_aliases
if(!$name) { my_usage; exit 1 }
if($name -like 'rm') {
set_config $value $null | Out-Null
Write-Output "'$value' has been removed"
} elseif($null -ne $value) {
set_config $name $value | Out-Null
Write-Output "'$name' has been set to '$value'"
} else {
$value = get_config $name
if($null -eq $value) {
Write-Output "'$name' is not set"
} else {
Write-Output $value
}
}
exit 0