File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ Copyright = '(c) Christoph Bergmeister. All rights reserved.'
3333Description = ' Proxy command around Set-Location and its aliases to defer import of posh-git until one is in a git directory.'
3434
3535# Minimum version of the PowerShell engine required by this module
36- PowerShellVersion = ' 7 .0'
36+ PowerShellVersion = ' 5 .0'
3737
3838# Name of the PowerShell host required by this module
3939# PowerShellHostName = ''
Original file line number Diff line number Diff line change @@ -86,7 +86,8 @@ function Set-Location {
8686 }
8787 if (Test-Path (Join-Path $PWD.Path ' .git' )) {
8888 Import-Module posh- git
89- if (Test-Path $PostImportScriptPath ) {
89+ # The first condition helps to prevent ParameterBindingException on PowerShell 5
90+ if ($PostImportScriptPath -and $ (Test-Path $PostImportScriptPath )) {
9091 & $PostImportScriptPath
9192 }
9293 }
You can’t perform that action at this time.
0 commit comments