Skip to content

Use Environment.ProcessId in SpecialVariables.PID #24926

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 3 commits into from
Feb 4, 2025

Conversation

fMichaleczek
Copy link
Contributor

@fMichaleczek fMichaleczek commented Feb 3, 2025

PR Summary

Continue #14063

Applying CA1837 https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1837

PR Context

Improve Microsoft.PowerShell.SDK doesn't work in a AspNetCore Blazor WebAssembly project

Process.GetCurrentProcess().Id is not available on net9.0-Browser.

With Environment.ProcessId, the API doesn't throw anymore :

image

PR Checklist

@iSazonov

This comment was marked as outdated.

This comment was marked as outdated.

@iSazonov

This comment was marked as outdated.

@iSazonov

This comment was marked as outdated.

This comment was marked as outdated.

@iSazonov iSazonov added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Feb 4, 2025
@iSazonov

This comment was marked as outdated.

This comment was marked as outdated.

@iSazonov iSazonov self-assigned this Feb 4, 2025
@iSazonov iSazonov changed the title Continue Enable CA1837: Use 'Environment.ProcessId' Use Environment.ProcessId in SpecialVariables.PID Feb 4, 2025
@iSazonov iSazonov merged commit 141da81 into PowerShell:master Feb 4, 2025
39 of 41 checks passed
Copy link
Contributor

microsoft-github-policy-service bot commented Feb 4, 2025

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

🔗 https://aka.ms/PSRepoFeedback

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