Skip to content

Fix IDE0083: UseNotPattern#26213

Merged
TravisEz13 merged 1 commit intoPowerShell:masterfrom
xtqqczze:IDE0083-p2
Oct 17, 2025
Merged

Fix IDE0083: UseNotPattern#26213
TravisEz13 merged 1 commit intoPowerShell:masterfrom
xtqqczze:IDE0083-p2

Conversation

@xtqqczze
Copy link
Copy Markdown
Contributor

@xtqqczze xtqqczze commented Oct 16, 2025

@xtqqczze xtqqczze marked this pull request as ready for review October 16, 2025 10:21
@iSazonov iSazonov added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Oct 16, 2025
@xtqqczze
Copy link
Copy Markdown
Contributor Author

@iSazonov Please approve workflows.

@xtqqczze
Copy link
Copy Markdown
Contributor Author

@TravisEz13 Please could you review.

@TravisEz13 TravisEz13 requested a review from Copilot October 17, 2025 18:05
@TravisEz13
Copy link
Copy Markdown
Member

/azp run PowerShell-CI-linux-packaging, PowerShell-Windows-Packaging-CI

Copy link
Copy Markdown
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 applies IDE0083 code style rule to modernize pattern matching by converting negated is expressions to use the not pattern. The changes update 13 files to replace the older if (!(expression is Type variable)) syntax with the more concise if (expression is not Type variable) pattern.

  • Updates pattern matching syntax to use C# 9.0 not pattern
  • Improves code readability and consistency with modern C# style
  • No functional changes, only syntactic improvements

Reviewed Changes

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

Show a summary per file
File Description
ServerRemoteHost.cs Updates negated type check for RemoteRunspace
InitialSessionStateProvider.cs Updates negated type check for Hashtable
EncodeAndDecode.cs Updates negated type checks for PSObject
RunspaceConnectionInfo.cs Updates negated type check for WSManConnectionInfo
ReceivePSSession.cs Updates negated type check for RemoteRunspace
InvokeCommandCommand.cs Updates negated type check for ExecutionCmdletHelperRunspace
CustomShellCommands.cs Updates negated type check for Hashtable
remoterunspaceinfo.cs Updates negated type check for RemoteRunspace
RemoteRunspacePoolInternal.cs Updates negated type check for WSManConnectionInfo
JobSourceAdapter.cs Updates negated type checks for Job2
Job.cs Updates negated type checks for RuntimeException, RemoteException, and PSRemotingChildJob
ClientMethodExecutor.cs Updates negated type check for IHostSupportsInteractiveSession

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

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@TravisEz13 TravisEz13 merged commit 2786fce into PowerShell:master Oct 17, 2025
34 of 35 checks passed
@microsoft-github-policy-service
Copy link
Copy Markdown
Contributor

microsoft-github-policy-service Bot commented Oct 17, 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 IDE0083-p2 branch October 17, 2025 18:44
SIRMARGIN pushed a commit to SIRMARGIN/PowerShell that referenced this pull request Dec 12, 2025
kilasuit pushed a commit to kilasuit/PowerShell that referenced this pull request Jan 2, 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.

4 participants