Skip to content

Test-Connection needs to be revised due to an intentional breaking change in .NET 7 #17018

@daxian-dbw

Description

@daxian-dbw

Prerequisites

Steps to reproduce

Here is the dotnet issue: dotnet/runtime#66746
Here is the breaking change note: dotnet/docs#28720

Basically, System.Net.NetworkInformation.Ping doesn't support specifying payload on Linux:

  • it throws PlatformNotSupported exception when custom Ping payload is specified, when the process is not running as root.
  • even if running as root (sudo), the custom payload is simply ignored because on Linux it's implemented by interfacing with the ping native utility, which doesn't support specifying custom payload.

So, whatever functionality in Test-Connection that depends on specifying custom payload is broken and should be either fixed or removed.

Attention: Workaround was added to test code in Test-Connection.Tests.ps1 by #16930. Please fix the tests when resolving this bug, or removing the related tests if the affected functionalities will be removed.

Expected behavior

N/A

Actual behavior

N/A

Error details

N/A

Environment data

PowerShell 7.3-preview.3

Visuals

No response

Metadata

Metadata

Assignees

Labels

In-PRIndicates that a PR is out for the issueIssue-BugIssue has been identified as a bug in the productWG-Cmdletsgeneral cmdlet issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions