-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.ps1
52 lines (43 loc) · 1.84 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
$baseurl = "https://raw.githubusercontent.com/Velosofy/dotfiles/master"
if (!(Get-Command scoop)) {
Write-Host "Installing Scoop..."
Invoke-RestMethod get.scoop.sh | Invoke-Expression
}
else {
scoop update
}
scoop install main/git
scoop bucket add extras
scoop install main/wget
scoop install main/aria2
scoop install main/ripgrep
scoop install main/fzf
scoop install main/bat
scoop install main/eza
scoop install main/tre-command
scoop install extras/lazygit
scoop install scoop-search
if (!(Get-Command winget)) {
Write-Warning "Winget is not installed. Installing using scoop..."
scoop install main/winget
}
$question = 'Do you want to use WinINet for winget? If you''re not sure, select No'
$choices = '&Yes', '&No'
$decision = $Host.UI.PromptForChoice('', $question, $choices, 1)
if ($decision -eq 0) {
Write-Host "Using WinINet for winget..."
Invoke-RestMethod -Uri "$baseurl/win/winget-settings.json" -OutFile $env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
}
else {
Write-Host "Using Delivery Optimization for winget..."
}
Invoke-RestMethod -Uri "$baseurl/win/apps.json" -OutFile $ENV:TEMP\apps.json
Start-Process -FilePath "pwsh" -ArgumentList "-NoExit -Command winget import -i $ENV:TEMP\apps.json --accept-source-agreements --accept-package-agreements" -Verb RunAs
Remove-Item $ENV:TEMP\apps.json
Install-Module -Name PSReadLine -Scope CurrentUser -Force -AcceptLicense
Install-Module -Name PSFzf -Scope CurrentUser -Force -AcceptLicense
mkdir $HOME\.config -ErrorAction SilentlyContinue
Invoke-RestMethod -Uri "$baseurl/win/Microsoft.PowerShell_profile.ps1" -OutFile $PROFILE
Invoke-RestMethod -Uri "$baseurl/.config/starship.toml" -OutFile $HOME\.config\starship.toml
Invoke-RestMethod -Uri "$baseurl/.config/ripgrep.conf" -OutFile $HOME\.config\ripgrep.conf
Write-Host "Done."