X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/blobdiff_plain/73d72e1b4cd9cd7174d5d4285e27f9c70ae8058f..a6f0d53689a2494f174e44de2f62bdc98e8bc444:/install/profile.ps1 diff --git a/install/profile.ps1 b/install/profile.ps1 index 2cd28a8..e1061ac 100644 --- a/install/profile.ps1 +++ b/install/profile.ps1 @@ -7,7 +7,6 @@ Setup EdTheDev's PowerShell Profile #> - # Setup my PowerShell Profile (on Windows) if(-Not(Test-Path -Path $profile)) { New-Item -Path "$profile" -ItemType File @@ -15,16 +14,22 @@ if(-Not(Test-Path -Path $profile)) { # Install Stub PowerShell Profile that sources the one from DotFiles $sourceMeFile = "$pwd\Microsoft.PowerShell_profile.ps1" -$sourceMeLine = '$profileContents = [string]::join([environment]::newline, (get-content -path' +$sourceMeLine = '$profileContents = [string]::join([environment]::newline, (get-content -path ' $sourceMeLine += $sourceMeFile $sourceMeLine += '));invoke-expression $profileContents' -$doneFlagFile = "./DONE.md" -$doBootStrap = -Not (Test-Path -Path $doneFlagFile) +# $doneFlagFile = "./DONE.md" +# $doBootStrap = -Not (Test-Path -Path $doneFlagFile) -$profileContents = Get-Content $profile -if(! $profileContents -contains $sourceMeLine) { - Add-Content -Path $profile -Value $sourceMeLine +$profileStuff = Get-Content -Path $profile +if($profileStuff -Contains $sourceMeLine) { + Write-Host "Found profile source line: $sourceMeLine" + Write-Host "in file $profile" +} +else { + Write-Host "Profile source line will be added to $profile" + Add-Content -Path $profile -Value "" # Blank line to enforce newline. + Add-Content -Path $profile -Value $sourceMeLine } # Install profile for Windows Terminal @@ -35,3 +40,5 @@ if(! $profileContents -contains $sourceMeLine) { # # Brute force ensure we update our git copy once in awhile. # Copy-Item -Path $destFile -Destination ./profiles.json #} + +PowerShellGet\Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force \ No newline at end of file