1
0
Fork 0
dotfiles/run_once_prepare_windows.ps1

34 lines
1.3 KiB
PowerShell
Raw Normal View History

2022-04-12 13:56:22 +02:00
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
2022-04-13 23:47:11 +02:00
# Install required packages with winget
winget install alacritty gitui
2022-04-12 13:56:22 +02:00
2022-04-13 23:47:11 +02:00
# Install other packages with scoop because not available in winget
try{
Get-Command -Name scoop -ErrorAction Stop
}
catch{
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
}
2022-04-13 23:09:10 +02:00
2022-04-13 23:47:11 +02:00
scoop install neovim
2022-04-13 23:09:10 +02:00
2022-04-13 23:47:11 +02:00
# Install fonts
scoop bucket add nerd-fonts
scoop install FiraCode-NF FiraCode-NF-Mono FiraMono-NF FiraCode-Script FiraCode Delugia-Nerd-Font-Complete Delugia-Mono-Nerd-Font-Complete Cascadia-Code CascadiaCode-NF CascadiaCode-NF-Mono
2022-04-13 23:09:10 +02:00
2022-04-13 23:48:31 +02:00
$CommandLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
2022-04-13 23:47:11 +02:00
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine
2022-04-13 23:48:31 +02:00
Start-Sleep -Seconds 1
2022-04-13 23:47:11 +02:00
} else {
try {
$appDatasToSymlink = 'gitui'
Foreach ($item in $appDatasToSymlink) {
$config_folder = "$env:USERPROFILE\.config\$item"
$symlink_folder = "$env:APPDATA\$item"
New-Item -Force -Path $symlink_folder -ItemType SymbolicLink -Value $config_folder
}
Exit
} catch {
Start-Sleep -Seconds 10
}
}