diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index fcaa56e..7084efd 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -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) ){