]> us-delaporte.pagekite.me Git - dotfiles.git/blob - install/profile.ps1
Move profile setup stuff to dedicated script.
[dotfiles.git] / install / profile.ps1
1 <#
2 .SYNOPSIS
3
4 Setup EdTheDev's PowerShell Profile
5
6 .NOTES
7
8 #>
9
10
11 # Setup my PowerShell Profile (on Windows)
12 if(-Not(Test-Path -Path $profile)) {
13 New-Item -Path "$profile" -ItemType File
14 }
15
16 # Install Stub PowerShell Profile that sources the one from DotFiles
17 $sourceMeFile = "$pwd\Microsoft.PowerShell_profile.ps1"
18 $sourceMeLine = '$profileContents = [string]::join([environment]::newline, (get-content -path'
19 $sourceMeLine += $sourceMeFile
20 $sourceMeLine += '));invoke-expression $profileContents'
21
22 $doneFlagFile = "./DONE.md"
23 $doBootStrap = -Not (Test-Path -Path $doneFlagFile)
24
25 $profileContents = Get-Content $profile
26 if(! $profileContents -contains $sourceMeLine) {
27 Add-Content -Path $profile -Value $sourceMeLine
28 }
29
30 # Install profile for Windows Terminal
31 # $destFile = "C:\Users\delaport\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\profiles.json"
32 # if(-Not(Test-Path -Path $destFile)) {
33 # Copy-Item -Path ./profiles.json -Destination $destFile
34 # } else {
35 # # Brute force ensure we update our git copy once in awhile.
36 # Copy-Item -Path $destFile -Destination ./profiles.json
37 #}