Summary of the new feature / enhancement
There's a bunch of legacy code specifically for compat with PSv2 (a more exhaustive search should be done locally as GitHub doesn't find all matches): https://github.com/PowerShell/PowerShell/search?l=C%23&q=psv2
Since PS 2.0 was officially deprecated Aug 2017 (https://learn.microsoft.com/en-us/powershell/scripting/windows-powershell/starting-the-windows-powershell-2.0-engine?view=powershell-7.2), there's no need to keep this code around.
Proposed technical implementation details (optional)
Review and remove all PSv2 specific code paths
Summary of the new feature / enhancement
There's a bunch of legacy code specifically for compat with PSv2 (a more exhaustive search should be done locally as GitHub doesn't find all matches): https://github.com/PowerShell/PowerShell/search?l=C%23&q=psv2
Since PS 2.0 was officially deprecated Aug 2017 (https://learn.microsoft.com/en-us/powershell/scripting/windows-powershell/starting-the-windows-powershell-2.0-engine?view=powershell-7.2), there's no need to keep this code around.
Proposed technical implementation details (optional)
Review and remove all PSv2 specific code paths