Skip to content

Fix IDE0049 in System.Management.Automation. Part 4 - #27380

Merged
Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
xtqqczze:IDE0049-sma-p4
May 6, 2026
Merged

Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
xtqqczze:IDE0049-sma-p4

Conversation

@xtqqczze

@xtqqczze xtqqczze commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

Contributes to: #25922.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 continues the IDE0049 style cleanup in System.Management.Automation remoting code by replacing framework type names (e.g., Int32, UInt32, Int64, String, UInt16) with the equivalent C# language keywords (e.g., int, uint, long, string, ushort) in casts, constants, and attributes.

Changes:

  • Update ETW/logging casts to use long/uint keywords.
  • Replace Int32.MaxValue/UInt32.MaxValue/UInt16.MaxValue/String.Join usage with int.MaxValue/uint.MaxValue/ushort.MaxValue/string.Join.
  • Apply keyword-based type usage in a few overridden members/locals for consistency.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/System.Management.Automation/engine/remoting/fanin/PriorityCollection.cs Uses long/uint keyword casts in ETW logging for received fragments.
src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs Uses uint.MaxValue constant and uint keyword casts for ETW logging fields.
src/System.Management.Automation/engine/remoting/common/fragmentor.cs Uses long/uint keyword casts in ETW logging for sent fragments.
src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs Uses int.MaxValue and string.Join keywords for timeouts and argv parsing.
src/System.Management.Automation/engine/remoting/commands/getrunspacecommand.cs Uses ushort.MaxValue in ValidateRange for Port.
src/System.Management.Automation/engine/remoting/commands/WaitJob.cs Uses int.MaxValue in ValidateRange for Timeout.
src/System.Management.Automation/engine/remoting/commands/StartJob.cs Uses int keyword in overridden ThrottleLimit signature.
src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs Uses ushort.MaxValue in ValidateRange for Port and long keyword for error parsing local.
src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs Uses ushort.MaxValue in ValidateRange for Port.
src/System.Management.Automation/engine/remoting/client/RemotingProtocol2.cs Uses int.MaxValue in NonBlockingRead calls.

@daxian-dbw Dongbo Wang (daxian-dbw) added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label May 6, 2026
@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 1919ba8 into PowerShell:master May 6, 2026
38 of 41 checks passed
@xtqqczze
xtqqczze deleted the IDE0049-sma-p4 branch May 6, 2026 23:45
Justin Grote (JustinGrote) pushed a commit to JustinGrote/PowerShell that referenced this pull request Jun 2, 2026
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-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