Skip to content

Use Environment.ProcessId in SpecialVariables.PID - #24926

Merged
Ilya (iSazonov) merged 3 commits into
PowerShell:masterfrom
fMichaleczek:CA1837
Feb 4, 2025
Merged

Use Environment.ProcessId in SpecialVariables.PID#24926
Ilya (iSazonov) merged 3 commits into
PowerShell:masterfrom
fMichaleczek:CA1837

Conversation

@fMichaleczek

@fMichaleczek Flavien MICHALECZEK (fMichaleczek) commented Feb 3, 2025

Copy link
Copy Markdown
Contributor

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.

@azure-pipelines

This comment was marked as outdated.

@iSazonov

This comment was marked as outdated.

@iSazonov

This comment was marked as outdated.

@azure-pipelines

This comment was marked as outdated.

@iSazonov Ilya (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
Comment thread src/System.Management.Automation/engine/SessionState.cs Outdated
@iSazonov

This comment was marked as outdated.

@azure-pipelines

This comment was marked as outdated.

@iSazonov Ilya (iSazonov) self-assigned this Feb 4, 2025
@iSazonov Ilya (iSazonov) changed the title Continue Enable CA1837: Use 'Environment.ProcessId' Use Environment.ProcessId in SpecialVariables.PID Feb 4, 2025
@iSazonov
Ilya (iSazonov) merged commit 141da81 into PowerShell:master Feb 4, 2025
@microsoft-github-policy-service

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

Copy link
Copy Markdown
Contributor

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

🔗 https://aka.ms/PSRepoFeedback

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/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-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