fix powershell profile.d

This commit is contained in:
Dax T. Games 2018-11-17 19:55:24 -05:00
parent 787ac3773c
commit 7203671fc9

18
vendor/profile.ps1 vendored
View File

@ -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
}
}