mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 17:59:11 +08:00
$PSScriptRoot compatibility
$PSScriptRoot is not available on PS version 2 or below. So we'll set it ourselves.
This commit is contained in:
parent
c38f6b3a89
commit
c15e29ecb3
7
vendor/profile.ps1
vendored
7
vendor/profile.ps1
vendored
@ -1,4 +1,9 @@
|
||||
# Add Cmder modules directory to the autoload path.
|
||||
# Compatibility with PS major versions <= 2
|
||||
if(!$PSScriptRoot) {
|
||||
$PSScriptRoot = Split-Path $Script:MyInvocation.MyCommand.Path
|
||||
}
|
||||
|
||||
# Add Cmder modules directory to the autoload path.
|
||||
$CmderModulePath = Join-path $PSScriptRoot "psmodules/"
|
||||
|
||||
if( -not $env:PSModulePath.Contains($CmderModulePath) ){
|
||||
|
Loading…
Reference in New Issue
Block a user