]> apps.delaporte.us Git - dotfiles.git/blobdiff - bootstrap.ps1
Cleverness to ensure my local profile gets sourced.
[dotfiles.git] / bootstrap.ps1
index 8cf3bf1991060f4a5a5d0ee3dd90f73dc5d6b22f..637716894073ac7ee606d3b7b4d80b1318f8f7fd 100644 (file)
@@ -2,7 +2,13 @@
 if(-Not(Test-Path -Path $profile)) {
   New-Item -Path "$profile" -ItemType File
 }
-$sourceMeLine = "source $pwd/Microsoft.PowerShell_profile.ps1"
+$sourceMeFile = "$pwd\Microsoft.PowerShell_profile.ps1"
+$sourceMeLine = '$profileContents = [string]::join([environment]::newline, (get-content -path'
+$sourceMeLine += $sourceMeFile
+$sourceMeLine += '));invoke-expression $profileContents'
+
+Write-Host $sourceMeLine
+
 $profileContents = Get-Content $profile 
 if(! $profileContents -contains $sourceMeLine) {
   Add-Content -Path $profile -Value $sourceMeLine