From e0b2c3216dddfd6696e44f38d44ef4ebae7f1a5b Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Wed, 18 Dec 2019 15:14:56 -0600 Subject: [PATCH] Cleverness to ensure my local profile gets sourced. --- Microsoft.PowerShell_profile.ps1 | 11 ++++++++++- bootstrap.ps1 | 8 +++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Microsoft.PowerShell_profile.ps1 b/Microsoft.PowerShell_profile.ps1 index 46c9bdf..53a6fc4 100644 --- a/Microsoft.PowerShell_profile.ps1 +++ b/Microsoft.PowerShell_profile.ps1 @@ -1,3 +1,12 @@ # Path to Flutter -$ENV:PATH +=":/home/delaport/development/flutter/bin" # Kali under WSL \ No newline at end of file +$ENV:PATH +=":/home/delaport/development/flutter/bin" # Kali under WSL + +# Some Paths that are annoying to find/restore if the installer fails +$ENV:PATH+=";C:\Program Files\Python38\Scripts\;C:\Program Files\Python38\" +$ENV:PATH+=";C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Docker\Docker\Resources\bin" +$ENV:PATH+=";C:\Program Files (x86)\Common Files\Oracle\Java\javapath" +$ENV:PATH+=";C:\Program Files\Microsoft VS Code\bin" +$ENV:PATH+=";C:\Program Files\Git\cmd" +$ENV:PATH+=";C:\ProgramData\chocolatey\bin" +$ENV:PATH+=";C:\PENGUIN" # Flag to ensure my profile kicked in. \ No newline at end of file diff --git a/bootstrap.ps1 b/bootstrap.ps1 index 8cf3bf1..6377168 100644 --- a/bootstrap.ps1 +++ b/bootstrap.ps1 @@ -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 -- 2.47.3