-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstall.ps1
70 lines (53 loc) · 1.32 KB
/
Install.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# -----------------------
# Source Helper Functions
# -----------------------
# Import helper functions
Get-ChildItem -Path "$PSScriptRoot\Helpers" -Filter "*.ps1" | ForEach-Object {
. $_.FullName -Force -Verbose
}
# ------------
# Installation
# ------------
# Exit script if not running as administrator
if (-Not (Test-IsElevated)) {
Write-Error -Message "Requires Administrator Privileges!"
return
}
# Symlink Everything into Place
# -----------------------------
. $PSScriptRoot\Symlink.ps1
# Install PowerShell Modules
# --------------------------
$Modules = @(
"BurntToast",
"CompletionPredictor",
"Terminal-Icons",
"posh-git",
"PSFzf",
"z",
"Microsoft.PowerShell.SecretManagement",
"Microsoft.PowerShell.SecretStore",
)
Write-Host "Installing PowerShell Modules ..."
foreach ($Module in $Modules) {
Install-Module -Name $Module -Force
}
# Update Help for Modules
# -----------------------
Write-Host "Updating Help ..."
Update-Help -Force
# WinGet
# ------
if (Find-Path winget | Test-Path) {
winget import .\WinGet\packages.json
}
# Scoop
# -----
if (Find-Path scoop | Test-Path) {
scoop import .\Scoop\scoopfile.json
}
# GitHub CLI
# ----------
if (Find-Path gh | Test-Path) {
Get-Content .\GitHub\gh\extensions.txt | ForEach-Object { gh extension install $_ }
}