From 7203671fc9fe2922c4de6e3c484b1c347855b2eb Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sat, 17 Nov 2018 19:55:24 -0500 Subject: [PATCH] fix powershell profile.d --- vendor/profile.ps1 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index 995b745..159ebe2 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -128,20 +128,30 @@ if (-not (test-path "$ENV:CMDER_ROOT\config\profile.d")) { } pushd $ENV:CMDER_ROOT\config\profile.d -foreach ($x in Get-ChildItem *.ps1) { +foreach ($x in Get-ChildItem *.psm1) { # write-host write-host Sourcing $x Import-Module $x } + +foreach ($x in Get-ChildItem *.ps1) { + # write-host write-host Sourcing $x + . $x +} popd # Drop *.ps1 files into "$ENV:CMDER_USER_CONFIG\config\profile.d" # to source them at startup. Requires using cmder.exe /C [cmder_user_root_path] argument if ($ENV:CMDER_USER_CONFIG -ne "" -and (test-path "$ENV:CMDER_USER_CONFIG\profile.d")) { pushd $ENV:CMDER_USER_CONFIG\profile.d - foreach ($x in Get-ChildItem *.ps1) { + foreach ($x in Get-ChildItem *.psm1) { # write-host write-host Sourcing $x Import-Module $x } + + foreach ($x in Get-ChildItem *.ps1) { + # write-host write-host Sourcing $x + . $x + } popd } @@ -153,7 +163,7 @@ if (test-path "$env:CMDER_ROOT\config\user-profile.ps1") { $CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config\user_profile.ps1" if (Test-Path $CmderUserProfilePath) { # Create this file and place your own command in there. - Import-Module "$CmderUserProfilePath" + . "$CmderUserProfilePath" # user_profile.ps1 is not a module DO NOT USE import-module } if ($ENV:CMDER_USER_CONFIG) { @@ -166,7 +176,7 @@ if ($ENV:CMDER_USER_CONFIG) { $CmderUserProfilePath = Join-Path $ENV:CMDER_USER_CONFIG "user_profile.ps1" if (Test-Path $CmderUserProfilePath) { - Import-Module "$CmderUserProfilePath" + . "$CmderUserProfilePath" # user_profile.ps1 is not a module DO NOT USE import-module } }