-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.ps1
34 lines (28 loc) · 1.51 KB
/
init.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
# Add needed modules
Import-Module "~\.dotfiles\pwsh\Modules\Core-Functions\Core-Functions.psm1"
Import-Module "~\.dotfiles\pwsh\Modules\Install-Fonts\Install-Fonts.psm1"
# Install Oh My Posh
# https://ohmyposh.dev/docs/installation/windows
winget install JanDeDobbeleer.OhMyPosh -s winget
# Install 1Password
winget install AgileBits.1Password -s winget
winget install AgileBits.1Password.CLI -s winget
# Install fonts
$dir = "~\Downloads\Fonts"
If(!(test-path $dir)) {New-Item -ItemType Directory -Force -Path $dir}
Start-BitsTransfer "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FiraCode.zip" $dir\FiraCode.zip
Expand-Archive -Path $dir\FiraCode.zip -DestinationPath $dir
Get-ChildItem -Path $dir *.ttf | ForEach-Object { Remove-Item -Path $_.FullName }
Get-ChildItem -Path $dir Fura* | ForEach-Object { Remove-Item -Path $_.FullName }
Get-ChildItem -Path $dir *Mono* | ForEach-Object { Remove-Item -Path $_.FullName }
Get-ChildItem -Path $dir -Exclude "*Windows Compatible.otf" | ForEach-Object { Remove-Item -Path $_.FullName }
Install-FontsFromDir $dir
Remove-ItemSafely $dir
# Delete exising profiles
Remove-ItemSafely ~\Documents\WindowsPowerShell
Remove-ItemSafely ~\Documents\PowerShell
# Get My Documents location
$docs = [Environment]::GetFolderPath('MyDocuments')
# Symlink profile to locations
New-Item -ItemType Junction -Path "$docs\WindowsPowerShell\" -Target (Get-Item '~\.dotfiles\pwsh').FullName
New-Item -ItemType Junction -Path "$docs\PowerShell\" -Target (Get-Item '~\.dotfiles\pwsh').FullName