]> apps.delaporte.us Git - dotfiles.git/blob - install/profile.ps1
Docker pirate Raspberry Pi recipe.
[dotfiles.git] / install / profile.ps1
1 <#
2 .SYNOPSIS
3
4 Setup EdTheDev's PowerShell Profile
5
6 .NOTES
7
8 #>
9
10 # Setup my PowerShell Profile (on Windows)
11 if(-Not(Test-Path -Path $profile)) {
12 New-Item -Path "$profile" -ItemType File
13 }
14
15 # Install Stub PowerShell Profile that sources the one from DotFiles
16 $sourceMeFile = "$pwd\Microsoft.PowerShell_profile.ps1"
17 $sourceMeLine = '$profileContents = [string]::join([environment]::newline, (get-content -path '
18 $sourceMeLine += $sourceMeFile
19 $sourceMeLine += '));invoke-expression $profileContents'
20
21 # $doneFlagFile = "./DONE.md"
22 # $doBootStrap = -Not (Test-Path -Path $doneFlagFile)
23
24 $profileStuff = Get-Content -Path $profile
25 if($profileStuff -Contains $sourceMeLine) {
26 Write-Host "Found profile source line: $sourceMeLine"
27 Write-Host "in file $profile"
28 }
29 else {
30 Write-Host "Profile source line will be added to $profile"
31 Add-Content -Path $profile -Value "" # Blank line to enforce newline.
32 Add-Content -Path $profile -Value $sourceMeLine
33 }
34
35 # Install profile for Windows Terminal
36 # $destFile = "C:\Users\delaport\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\profiles.json"
37 # if(-Not(Test-Path -Path $destFile)) {
38 # Copy-Item -Path ./profiles.json -Destination $destFile
39 # } else {
40 # # Brute force ensure we update our git copy once in awhile.
41 # Copy-Item -Path $destFile -Destination ./profiles.json
42 #}
43
44 PowerShellGet\Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force