mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 17:59:11 +08:00
Merge pull request #1865 from m01ar/master
Dot-Sourcing Error: PowerShell 5.1 and Windows Software Restriction Policy compatibility
This commit is contained in:
commit
798da058cc
@ -508,7 +508,7 @@
|
||||
<value name="Name" type="string" data="{PowerShell::PowerShell as Admin}"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||
<value name="Cmd1" type="string" data="*PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''""/>
|
||||
<value name="Cmd1" type="string" data="*PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression 'Import-Module ''%ConEmuDir%\..\profile.ps1'''""/>
|
||||
<value name="Active" type="long" data="0"/>
|
||||
<value name="Count" type="long" data="1"/>
|
||||
<value name="Flags" type="dword" data="00000000"/>
|
||||
@ -517,7 +517,7 @@
|
||||
<value name="Name" type="string" data="{PowerShell::PowerShell}"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||
<value name="Cmd1" type="string" data="PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''""/>
|
||||
<value name="Cmd1" type="string" data="PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression 'Import-Module ''%ConEmuDir%\..\profile.ps1'''""/>
|
||||
<value name="Cmd2" type="string" data=""%CMDER_ROOT%\vendor\git-for-windows\git-bash.exe""/>
|
||||
<value name="Active" type="long" data="0"/>
|
||||
<value name="Count" type="long" data="1"/>
|
||||
|
8
vendor/profile.ps1
vendored
8
vendor/profile.ps1
vendored
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user