-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Rename -Not parameter to -IsNullOrEmpty in Where-Object cmdlet. #6797
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
Conversation
|
Test-Connection.TraceRoute.TraceRoute works AppVeyor test failed. |
|
|
|
No, [pscustomobject] @{ Foo = $False } | Where-Object -Not Foo # OK, passes the input object through |
|
@mklement0 Agree, -IsNullOrEmpty is not ideal for [bool], but -Not has far wider meaning. So I think there should be better parameter name. |
|
I believe -IsFalseNullOrEmpty sounds horribly :) |
|
|
|
I agree with @mklement0. [pscustomobject] @{ Foo = 0 } | Where-Object -Not FooI don't see a problem with |
|
Sorry for creating confusion: in #6796 (comment) I was speaking in the abstract, giving general advice: you shouldn't just rename existing parameters, because that is a breaking change; if appropriate, a parameter alias can be implemented - but I do not think that that is appropriate here, for the reasons stated by me earlier and also by @iSazonov and @daxian-dbw. Note that The With strings, You can think of |
|
OK. |
PR Summary
-Not parameter is very ambiguous.
Is it better to rename it to -IsNullOrEmpty?
Also, ParameterSetName is changed to 'IsNullOrEmpty'.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests