Fix IDE0049 in System.Management.Automation. Part 4#27380
Merged
Conversation
Contributor
There was a problem hiding this comment.
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/uintkeywords. - Replace
Int32.MaxValue/UInt32.MaxValue/UInt16.MaxValue/String.Joinusage withint.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
approved these changes
May 6, 2026
JustinGrote
pushed a commit
to JustinGrote/PowerShell
that referenced
this pull request
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributes to: #25922.