-
-
Notifications
You must be signed in to change notification settings - Fork 473
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
Fix Should -HaveParamter -DefaultValue #2398
Conversation
Note to self: currently I see this, which suggests we "to string" the value, which makes sense since the parameter is a string. maybe we can look at our own invocation and see if the user provided the value as literal. Or change the DefaultValue to object.
|
There is some hidden potential in this, but I don't think it is worth the breaking change. I've reverted to the previous behavior where we cannot explicitly determine whether or not the default value was specified at all or if it was $null. We also cannot check for the exact literal of the default type, to distinguish '(Get-Date)' string and (Get-Date) expression. BUT the first feature does not have enough potential to warrant the breaking change, because there is not much difference between providing null default, and not providing one at all. And the second one can be overcome by #1888 and still is an edge case. |
@fflaten merged, let me know if you had any concerns :) |
PR Checklist
Create Pull Request
to mark it as a draft. PR can be markedReady for review
when it's ready.Fix #2388