4 Setup EdTheDev's PowerShell Profile
10 # Setup my PowerShell Profile (on Windows)
11 if(-Not(Test-Path -Path $profile)) {
12 New-Item -Path "$profile" -ItemType File
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'
21 # $doneFlagFile = "./DONE.md"
22 # $doBootStrap = -Not (Test-Path -Path $doneFlagFile)
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"
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
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
40 # # Brute force ensure we update our git copy once in awhile.
41 # Copy-Item -Path $destFile -Destination ./profiles.json
44 PowerShellGet\Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force