Update profile.ps1

Fixes Powershell 5.1 error when Windows Software Restriction Policy is enabled:

bin\vendor\profile.ps1 : Cannot dot-source this command because it was defined in a different language mode. To invoke this command without importing its contents, omit the '.'  operator.
At line:1 char:1
+ . 'bin\vendor\conemu-maximus5\..\profi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [profile.ps1], NotSupportedException
    + FullyQualifiedErrorId : DotSourceNotSupported,profile.ps1
This commit is contained in:
Dmitri S. Guskov 2018-08-29 14:38:59 +03:00 committed by GitHub
parent 4655888690
commit 34bb62409a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

8
vendor/profile.ps1 vendored
View File

@ -134,7 +134,7 @@ if (-not (test-path "$ENV:CMDER_ROOT\config\profile.d")) {
pushd $ENV:CMDER_ROOT\config\profile.d pushd $ENV:CMDER_ROOT\config\profile.d
foreach ($x in Get-ChildItem *.ps1) { foreach ($x in Get-ChildItem *.ps1) {
# write-host write-host Sourcing $x # write-host write-host Sourcing $x
. $x Import-Module $x
} }
popd popd
@ -144,7 +144,7 @@ if ($ENV:CMDER_USER_CONFIG -ne "" -and (test-path "$ENV:CMDER_USER_CONFIG\profil
pushd $ENV:CMDER_USER_CONFIG\profile.d pushd $ENV:CMDER_USER_CONFIG\profile.d
foreach ($x in Get-ChildItem *.ps1) { foreach ($x in Get-ChildItem *.ps1) {
# write-host write-host Sourcing $x # write-host write-host Sourcing $x
. $x Import-Module $x
} }
popd popd
} }
@ -154,13 +154,13 @@ if ($ENV:CMDER_USER_CONFIG -ne "" -and (test-path "$ENV:CMDER_USER_CONFIG\profil
$CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config\user-profile.ps1" $CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config\user-profile.ps1"
if (Test-Path $CmderUserProfilePath) { if (Test-Path $CmderUserProfilePath) {
# Create this file and place your own command in there. # Create this file and place your own command in there.
. "$CmderUserProfilePath" Import-Module "$CmderUserProfilePath"
} }
if ($ENV:CMDER_USER_CONFIG) { if ($ENV:CMDER_USER_CONFIG) {
$CmderUserProfilePath = Join-Path $ENV:CMDER_USER_CONFIG "user-profile.ps1" $CmderUserProfilePath = Join-Path $ENV:CMDER_USER_CONFIG "user-profile.ps1"
if (Test-Path $CmderUserProfilePath) { if (Test-Path $CmderUserProfilePath) {
. "$CmderUserProfilePath" Import-Module "$CmderUserProfilePath"
} }
} }