10BC0 Fix CA1837: Use 'Environment.ProcessId' by xtqqczze · Pull Request #26242 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@xtqqczze
Copy link
Contributor

Follow-up #14063

@xtqqczze xtqqczze marked this pull request as ready for review October 18, 2025 18:52
@iSazonov iSazonov requested a review from TravisEz13 October 20, 2025 05:17
@iSazonov iSazonov added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Oct 20, 2025
@TravisEz13 TravisEz13 requested a review from Copilot October 20, 2025 18:16
8000 @TravisEz13 TravisEz13 self-assigned this Oct 20, 2025
Copy link
Contributor
Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the code to use Environment.ProcessId instead of System.Diagnostics.Process.GetCurrentProcess().Id in compliance with code analyzer rule CA1837, which recommends the more efficient static property over the Process-based approach.

  • Replaces Process.GetCurrentProcess().Id with Environment.ProcessId for better performance

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@TravisEz13 TravisEz13 merged commit 9470212 into PowerShell:master Oct 20, 2025
34 of 35 checks passed
@microsoft-github-policy-service
Copy link
Contributor
microsoft-github-policy-service bot commented Oct 20, 2025

📣 Hey @@xtqqczze, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

@xtqqczze xtqqczze deleted the CA1837 branch October 20, 2025 18:24
SIRMARGIN pushed a commit to SIRMARGIN/PowerShell that referenced this pull request Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0