-
-
Notifications
You must be signed in to change notification settings - Fork 803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invoke-NullCoalescing lies #93
Comments
I believe I check for "falsey" rather than That said, you're right that exporting it doesn't make sense. I'll fix that. |
I just got a new W10 Anniversary image on my PC and tried
Looks like I have this cmdlet already from PSCX that must be installed. I'll keep playing around, but this is the first time I've seen this. This is PS 5.1.14393 edit: looks like when I restored my old profile and I had also gotten some PS modules we've developed and someone included PSCX and was adding the local paths to my environment bootup--so I removed that bootup sequence and therefore removed the reference to PSCX. |
|
I believe we are planning to not export this function in the 1.0.0 release. It will remain in the upcoming 0.7.0 release as we are trying to avoid potentially breaking changes. The 1.0.0 release however will gives us some latitude WRT breaking changes. |
Closed with PR #427 |
I'm not sure why this command is exported publicly? It has nothing to do with Git, and as such I'd prefer it to not be exported, honestly. If you are going to export it, though, it should do what the name says it does.
PS> Invoke-NullCoalescing '' 'oops'
oops
PS> Invoke-NullCoalescing $false 'oops'
oops
PS> Invoke-NullCoalescing 0 'oops'
oops
I'm sure you can think of many other ways to get the wrong result here. However, there is one more example that you may consider correct, but I find to be very confusing.
PS> Invoke-NullCoalescing { } 'oops'
oops
Invoking the ScriptBlocks may be what you need, but it seems very surprising to me. If I were to implement this it would have been simply:
To include the script block processing, something like:
The text was updated successfully, but these errors were encountered: