From 34bb62409a5b2f31c5092cdca602d892a1b40dc4 Mon Sep 17 00:00:00 2001 From: "Dmitri S. Guskov" Date: Wed, 29 Aug 2018 14:38:59 +0300 Subject: [PATCH 1/2] 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 --- vendor/profile.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index b59e773..2952618 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -134,7 +134,7 @@ if (-not (test-path "$ENV:CMDER_ROOT\config\profile.d")) { pushd $ENV:CMDER_ROOT\config\profile.d foreach ($x in Get-ChildItem *.ps1) { # write-host write-host Sourcing $x - . $x + Import-Module $x } 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 foreach ($x in Get-ChildItem *.ps1) { # write-host write-host Sourcing $x - . $x + Import-Module $x } 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" if (Test-Path $CmderUserProfilePath) { # Create this file and place your own command in there. - . "$CmderUserProfilePath" + Import-Module "$CmderUserProfilePath" } if ($ENV:CMDER_USER_CONFIG) { $CmderUserProfilePath = Join-Path $ENV:CMDER_USER_CONFIG "user-profile.ps1" if (Test-Path $CmderUserProfilePath) { - . "$CmderUserProfilePath" + Import-Module "$CmderUserProfilePath" } } From 21b1f009813fc7c4eef8c12a204424389ba413fb Mon Sep 17 00:00:00 2001 From: "Dmitri S. Guskov" Date: Wed, 29 Aug 2018 14:42:01 +0300 Subject: [PATCH 2/2] Powershell 5.1 compatibility 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 --- config/ConEmu.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/ConEmu.xml b/config/ConEmu.xml index db45a6a..c4f4fff 100644 --- a/config/ConEmu.xml +++ b/config/ConEmu.xml @@ -508,7 +508,7 @@ - + @@ -517,7 +517,7 @@ - +