-
Notifications
You must be signed in to change notification settings - Fork 2
/
Invoke-Config.ps1
95 lines (73 loc) · 3.38 KB
/
Invoke-Config.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# -----------
# Fetch files
# -----------
Set-Location -Path "~\repos\github"
git clone https://github.com/smholvoet/.dotfiles.git
Set-Location -Path "~\repos\github\.dotfiles"
# ---------------------------------------------------
# Nerd Fonts | https://www.nerdfonts.com
# replaced by 'choco install cascadia-code-nerd-font'
# ---------------------------------------------------
# $NFUrl = 'https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/CascadiaCode.zip'
# $NFZipFile = 'nerd-fonts.zip'
# $NFDir = 'nerd-fonts'
# $NFTempFolder = 'C:\Windows\Temp\Fonts'
# $NFDestination = (New-Object -ComObject Shell.Application).Namespace(0x14)
# Invoke-WebRequest -Uri $NFUrl -Outfile $NFZipFile
# Expand-Archive -Path $NFZipFile -DestinationPath $NFDir
# New-Item $NFTempFolder -Type Directory -Force | Out-Null
# Get-ChildItem -Path $NFDir -Recurse | ForEach {
# If (-not(Test-Path "C:\Windows\Fonts\$($_.Name)")) {
# Write-Host "Installing $($_.Name)"
# $Font = "$NFTempFolder\$($_.Name)"
# Copy-Item $($_.FullName) -Destination $NFTempFolder -Verbose
# $NFDestination.CopyHere($Font,0x10)
# Start-Sleep -s 15
# Remove-Item $Font -Force -Verbose
# }
# }
# Remove-Item $NFZipFile -Force -Verbose
# Remove-Item $NFDir -Recurse -Force -Verbose
# ---------------------------------
# oh-my-posh | https://ohmyposh.dev
# ---------------------------------
$OMPModuleDir = (Get-Module oh-my-posh).Path
Write-Host "oh-my-posh Module location: $($OMPModuleDir)"
$OMPThemesDir = Join-Path -Path (Split-Path -Path $OMPModuleDir -Parent) -ChildPath "\themes"
Write-Host "oh-my-posh Themes location: $($OMPThemesDir)"
$CustomTheme = "oh-my-posh\sander.omp.json"
Copy-Item $CustomTheme -Destination $OMPThemesDir -Force -Verbose
Set-PoshPrompt -Theme sander
# ------------------
# PowerShell profile
# ------------------
$PSProfileDir = Split-Path -Path $PROFILE -Parent
Write-Host "PowerShell PSPROFILE location: $($PSProfileDir)"
$PSProfile = "pwsh\Microsoft.PowerShell_profile.ps1"
Copy-Item $PSProfile -Destination $PSProfileDir -Force -Verbose
# ----------------
# Windows Terminal
# ----------------
$WindowsTerminalDir = Join-Path -Path $env:LocalAppData -ChildPath "\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState"
Write-Host "Windows Terminal location: $($WindowsTerminalDir)"
$WindowsTerminalSettings = "windows-terminal\settings.json"
Copy-Item $WindowsTerminalSettings -Destination $WindowsTerminalDir -Force -Verbose
# -------
# VS Code
# -------
$VSCodeDir = Join-Path -Path $env:APPDATA -ChildPath "\Code\User"
Write-Host "VS Code location: $($VSCodeDir)"
$VSCodeSettings = "vscode\settings.json"
$VSCodePsProfile = "vscode\Microsoft.VSCode_profile.ps1"
Copy-Item $VSCodeSettings -Destination $VSCodeDir -Force -Verbose
Copy-Item $VSCodePsProfile -Destination $VSCodeDir -Force -Verbose
# ----------------------------------------------------------------------
# Sophia Installer | https://github.com/farag2/Sophia-Script-for-Windows
# ----------------------------------------------------------------------
Invoke-RestMethod -Uri script.sophi.app | Invoke-Expression
$SophiaDir = "~/Downloads/Sophia Script for Windows 11 v6.0.7"
$SophiaCustom = "sophia\Sophia_custom.ps1"
Copy-Item $SophiaCustom -Destination $SophiaDir -Force -Verbose
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force
Set-Location -Path $SophiaDir
.\Sophia_custom.ps1