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