-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscoop.ps1
41 lines (38 loc) · 1.19 KB
/
scoop.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
37
38
39
40
41
# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
# irm scoop.liuzzi.net | iex
# Scoop
if (Get-Command -Name 'scoop' -ErrorAction Ignore) {
Write-Host 'Scoop is already installed.' -ForegroundColor Green
} else {
Write-Host 'Installing Scoop ...'
irm get.scoop.sh | iex
Write-Host 'Scoop has been installed.' -ForegroundColor Green
}
# Git
if (scoop list 6> $null | where Name -EQ git) {
Write-Host 'Git is already installed.' -ForegroundColor Green
} else {
Write-Host 'Installing Git ...'
scoop install git
Write-Host 'Git has been installed.' -ForegroundColor Green
}
# Buckets
$DesiredBuckets = @(
'extras'
'main'
'nerd-fonts'
'versions'
)
$InstalledBuckets = scoop bucket list
$MissingBuckets = $DesiredBuckets | where { $_ -notin $InstalledBuckets.Name }
if ($MissingBuckets) {
Write-Host 'Adding buckets ...'
$MissingBuckets | foreach {
Write-Host "- $_ ..."
scoop bucket add $_ *> $null
if ($LASTEXITCODE) { throw "Failed to add bucket '$_'." }
}
Write-Host 'All buckets have been added.' -ForegroundColor Green
} else {
Write-Host 'All buckets are already added.' -ForegroundColor Green
}