Skip to content

Suggest "-id pid" for "Get-Process pid"#8959

Merged
iSazonov merged 9 commits intoPowerShell:masterfrom
MohiTheFish:suggest-id-pid
Mar 1, 2019
Merged

Suggest "-id pid" for "Get-Process pid"#8959
iSazonov merged 9 commits intoPowerShell:masterfrom
MohiTheFish:suggest-id-pid

Conversation

@MohiTheFish
Copy link
Copy Markdown
Contributor

@MohiTheFish MohiTheFish commented Feb 23, 2019

fixes #2722

PR Summary

Suggest to use -id for Get-Process when a number is passed. (Instead of the error stating that there is no matching process name.)

PR Context

The error message has been changed to : Cannot find a process with the name "{0}". Try running with -Id to search by Id of process.

PR Checklist

@msftclas
Copy link
Copy Markdown

msftclas commented Feb 23, 2019

CLA assistant check
All CLA requirements met.

@MohiTheFish MohiTheFish changed the title Suggest "-id pid" Suggest "-id pid" for "Get-Process pid" Feb 23, 2019
@TylerLeonhardt
Copy link
Copy Markdown
Member

This is a student at HackIllinois. @rjmholt and I are working with the students here and are reviewing PRs that they send.

Copy link
Copy Markdown
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's getting there! 👍

Copy link
Copy Markdown
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some minor nitpicks, otherwise this looks good!

Copy link
Copy Markdown
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Awesome work.

@MohiTheFish
Copy link
Copy Markdown
Contributor Author

I was looking at the test that failed ["Import-Clixml StopProcessing should succeed"] and when I ran it locally, I found that it ran correctly. Git is saying there are no differences between my local version and the version online, so I'm not quite sure where it went wrong.
image

@TylerLeonhardt
Copy link
Copy Markdown
Member

TylerLeonhardt commented Feb 24, 2019

@MohiTheFish an intermittent failure. I'll restart the build.

Update: passed now :)

Copy link
Copy Markdown
Collaborator

@rjmholt rjmholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@iSazonov iSazonov requested a review from lzybkr February 25, 2019 04:51
@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Feb 25, 2019
@rjmholt rjmholt added the Hacktoberfest Potential candidate to participate in Hacktoberfest label Feb 25, 2019
@iSazonov
Copy link
Copy Markdown
Collaborator

@TylerLeonhardt @rjmholt Is the PR ready to merge?

string errorText = ProcessResources.NoProcessFoundForGivenName;
string errorName = "NoProcessFoundForGivenName";

if (int.TryParse(pattern, out int x) && x > 0)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it should be x >= 0?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I thought we want hide system process)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like if Get-Process -Id 0 would succeed, then we want to have the new error message here

@iSazonov iSazonov self-assigned this Mar 1, 2019
@iSazonov iSazonov merged commit 6f6b798 into PowerShell:master Mar 1, 2019
@TylerLeonhardt
Copy link
Copy Markdown
Member

@MohiTheFish congrats on your contribution!! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log Hacktoberfest Potential candidate to participate in Hacktoberfest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get-Process $pid should suggest using -Id $pid

6 participants