The definition of Out-Default seems to be breaking the usage of $?.
For example, if I run an invalid command in pwsh -noprofile, I get this:
PS C:\Users\chenxiaolong> git asdf
git: 'asdf' is not a git command. See 'git --help'.
The most similar command is
add
PS C:\Users\chenxiaolong> echo $?
False
If I import Get-ChildItemColor (version 2.1.1), then $? stops working properly:
PS C:\Users\chenxiaolong> Import-Module Get-ChildItemColor
PS C:\Users\chenxiaolong> git asdf
git: 'asdf' is not a git command. See 'git --help'.
The most similar command is
add
PS C:\Users\chenxiaolong> echo $?
True
If I remove the Out-Default function, then things work again, but of course, no more ls colors:
PS C:\Users\chenxiaolong> Remove-Item Function:Out-Default
PS C:\Users\chenxiaolong> git asdf
git: 'asdf' is not a git command. See 'git --help'.
The most similar command is
add
PS C:\Users\chenxiaolong> echo $?
False
The definition of
Out-Defaultseems to be breaking the usage of$?.For example, if I run an invalid command in
pwsh -noprofile, I get this:If I import
Get-ChildItemColor(version2.1.1), then$?stops working properly:If I remove the
Out-Defaultfunction, then things work again, but of course, no morelscolors: