C# 14 - Exploring extension members - .NET Blog

C# 14 introduces extension members. See how the `extension` syntax offers flexibility for extension authors and continuity for developers using extensions

.NET Blog

@DoctorDNS @sasstu it's already in .NET -- but the #PowerShell team does not enable basic #dotnet functionality if it came out after .NET 2.0 -- so you don't have access to #ExtensionMethods unless you map them into the .NET 1.0 era "ETS"

Here's the method in .NET:
https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.collectionextensions.getvalueordefault?view=net-7.0

Here's the pre-github era feature request:
https://github.com/PowerShell/PowerShell/issues/2226

CollectionExtensions.GetValueOrDefault Method (System.Collections.Generic)

Tries to get the value associated with the specified key in the dictionary.