Skip to content

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

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

Merged
merged 9 commits into from
Mar 1, 2019

Conversation

MohiTheFish
Copy link
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

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
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
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
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
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
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
Member

TylerLeonhardt commented Feb 24, 2019

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

Update: passed now :)

Copy link
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
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
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
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
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
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