-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Fix for #4520 '-ArgumentList should accept @() or $null' #6597
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 for #4520 '-ArgumentList should accept @() or $null' #6597
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be -ArgumentList "" ?
And should we tests -ArgumentList @() too?
|
@BrucePay can you please push an empty commit with |
|
@BrucePay I believe GitHub won't auto-close issues in the title, so I put For @markekraus' request, you can just do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use -TestCases and replace last three tests with one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather do this in a separate check-in. This whole file needs serious clean up e.g. there are tests that depend on notepad.
|
@BrucePay looks like you accidentally pulled in other commits into this PR. Find me tomorrow in the office to get this cleaned up. |
|
@SteveL-MSFT Not sure how it happened bu oh my yes :-( I will definitely find you. |
d2da162 to
761748a
Compare
Removed the [ValidateIsNotNulOrEmpty] attribute from the parameter.
…playing new windows on Windows.
761748a to
22e1d11
Compare
22e1d11 to
01603a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please submit the last commit with [Feature] in the commit message to execute the tests in the PR.
git commit --allow-empty
git push
| It 'Should run without errors when -ArgumentList is $null' { | ||
| $process = Start-Process $pingCommand -ArgumentList $null -PassThru @extraArgs | ||
| $process.Length | Should -Be 1 | ||
| $process.Id | Should -BeGreaterThan 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this check required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are basic sanity tests to make sure the process was created and is running (has an ID).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the process is not started the $process is $null.
| It "Should run without errors when -ArgumentList is @()" { | ||
| $process = Start-Process $pingCommand -ArgumentList @() -PassThru @extraArgs | ||
| $process.Length | Should -Be 1 | ||
| $process.Id | Should -BeGreaterThan 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are basic sanity tests to make sure the process was created and is running (has an ID).
| It "Should run without errors when -ArgumentList is ''" { | ||
| $process = Start-Process $pingCommand -ArgumentList '' -PassThru @extraArgs | ||
| $process.Length | Should -Be 1 | ||
| $process.Id | Should -BeGreaterThan 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are basic sanity tests to make sure the process was created and is running (has an ID).
|
pushed a commit with |
|
@adityapatwardhan Please make sure you check the PR title before merging. The |
|
@TravisEz13 Yes agreed, missed it. |
… affect current functionality PowerShell/PowerShell#6597
Fix #4520
Just removed the [ValidateIsNotNulOrEmpty] attribute from the ArgumentList parameter. (Also removed some obsolete comments).
PR Summary
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