Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,23 @@ private void RetrieveMatchingProcessesByProcessName()
if (!found &&
!WildcardPattern.ContainsWildcardCharacters(pattern))
{
string errorText = ProcessResources.NoProcessFoundForGivenName;
string errorName = "NoProcessFoundForGivenName";

if (int.TryParse(pattern, out int x) && x >= 0)
{
errorText = ProcessResources.RecommendIdTagForGivenName;
errorName = "RecommendIdTagForGivenName";
}

WriteNonTerminatingError(
pattern,
0,
pattern,
null,
ProcessResources.NoProcessFoundForGivenName,
"NoProcessFoundForGivenName",
ErrorCategory.ObjectNotFound);
processName: pattern,
processId: 0,
targetObject: pattern,
innerException: null,
resourceId: errorText,
errorId: errorName,
category: ErrorCategory.ObjectNotFound);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<data name="NoProcessFoundForGivenName" xml:space="preserve">
<value>Cannot find a process with the name "{0}". Verify the process name and call the cmdlet again.</value>
</data>
<data name="RecommendIdTagForGivenName" xml:space="preserve">
<value>Cannot find a process with the name "{0}". Try running with -Id to search by Id of processes.</value>
</data>
<data name="NoDebuggerFound" xml:space="preserve">
<value>This command cannot be run because the debugger cannot be attached to the process "{0} ({1})". Specify another process and Run your command.</value>
</data>
Expand Down