Skip to content

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

Merged
Ilya (iSazonov) merged 9 commits into
PowerShell:masterfrom
MohiTheFish:suggest-id-pid
Mar 1, 2019
Merged

Ilya (iSazonov) merged 9 commits into
PowerShell:masterfrom
MohiTheFish:suggest-id-pid

Conversation

@MohiTheFish

@MohiTheFish Muhammed Imran (MohiTheFish) commented Feb 23, 2019 •

Copy link
Copy Markdown
Contributor

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

Microsoft Contribution License Agreements (msftclas) commented Feb 23, 2019 •

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@MohiTheFish Muhammed Imran (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. Rob Holt (@rjmholt) and I are working with the students here and are reviewing PRs that they send.

@TylerLeonhardt TylerLeonhardt left a comment

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.

It's getting there! 👍

@TylerLeonhardt TylerLeonhardt left a comment

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.

just some minor nitpicks, otherwise this looks good!

@TylerLeonhardt TylerLeonhardt left a comment

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.

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

TylerLeonhardt commented Feb 24, 2019 •

Copy link
Copy Markdown
Member

Muhammed Imran (@MohiTheFish) an intermittent failure. I'll restart the build.

Update: passed now :)

@rjmholt Rob Holt (rjmholt) left a comment

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.

LGTM!

@iSazonov Ilya (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 Rob Holt (rjmholt) added the Hacktoberfest Potential candidate to participate in Hacktoberfest label Feb 25, 2019
@iSazonov

Copy link
Copy Markdown
Collaborator

TylerLeonhardt Rob Holt (@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 Ilya (iSazonov) self-assigned this Mar 1, 2019
@iSazonov
Ilya (iSazonov) merged commit 6f6b798 into PowerShell:master Mar 1, 2019
@TylerLeonhardt

Copy link
Copy Markdown
Member

Muhammed Imran (@MohiTheFish) congrats on your contribution!! 🎉

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
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