Target pwsh LTS .NET
<!-- Anything that looks like this is a comment and can't be seen after the Pull Request is created. -->
# PR Summary
This pull request upgrades the PSReadLine project to target .NET 8 and PowerShell 7.4+, removing legacy and polyfill code for older frameworks. It updates all project files, build scripts, and dependencies to use the latest versions, and enforces compatibility at both the module and script level. The most important changes are summarized below.
**Framework and Dependency Upgrades:**
* All projects (`PSReadLine`, `MockPSConsole`, and tests) now target `.NET 8.0` exclusively, removing support for older frameworks such as `netstandard2.0`, `net472`, and `net6.0`. Corresponding dependencies are updated to the latest compatible versions, including `Microsoft.PowerShell.SDK` 7.4.0. (`[[1]](diffhunk://#diff-15b49bb2c4d47eeb9db538533ac5b972f85f34ba280b7acb42c1b5c27db438e9L8-R21)`, `[[2]](diffhunk://#diff-3fcef917fe90ddf5a3b2ef1d86c3505ec20ab64f86c0febed8d682b19f8a84a3L7-R14)`, `[[3]](diffhunk://#diff-08cd1f3a887d8dcf95b9437203d198df174e72fa3bed3645db09901adb95ac2fL8-R8)`, `[[4]](diffhunk://#diff-08cd1f3a887d8dcf95b9437203d198df174e72fa3bed3645db09901adb95ac2fL17-R18)`)
* The build process and `global.json` are updated to require .NET SDK 8.0.416. (`[[1]](diffhunk://#diff-8df3cd354bc584349d04ad5675b33c042d8b99b741b8b95af394c55e0f5001bfR1-R7)`, `[[2]](diffhunk://#diff-cf52a72665faf1250da83a9745360bf052fadf8f4a395bf0557d6f1b6ffcec18L22-L63)`)
**PowerShell Version Requirement:**
* The module manifest (`PSReadLine.psd1`) and the main module script (`PSReadLine.psm1`) now require PowerShell 7.4 or later. The script throws a clear error if loaded in an older version, with instructions for users. (`[[1]](diffhunk://#diff-249c945874c86bf263442fb1b4ffbc108e8642a3ce9b0d05a6e1b103a7933bbeL4-R10)`, `[[2]](diffhunk://#diff-7a6a99977c8583b1131f983549f09dac821eb025205e76fa1d4ce533438bcb4aR1-R14)`)
**Removal of Legacy and Polyfill Code:**
* The `Polyfill` project and related code (including `CommandPrediction.cs` and `Polyfill.csproj`) are deleted, simplifying the codebase and eliminating support for legacy PowerShell versions. Build scripts are updated to remove all polyfill-related tasks. (`[[1]](diffhunk://#diff-ed6d8ebde2b95773782d7bbedbc734f0a7f97b1d70355fee2e6b9f130329481fL1-L232)`, `[[2]](diffhunk://#diff-9bbfd47219535f7987f69c047ce2324aba293c39340a1edb0be346d75cde5f0aL1-L22)`, `[[3]](diffhunk://#diff-cf52a72665faf1250da83a9745360bf052fadf8f4a395bf0557d6f1b6ffcec18L22-L63)`, `[[4]](diffhunk://#diff-cf52a72665faf1250da83a9745360bf052fadf8f4a395bf0557d6f1b6ffcec18L100-R92)`, `[[5]](diffhunk://#diff-cf52a72665faf1250da83a9745360bf052fadf8f4a395bf0557d6f1b6ffcec18L118-R110)`)
**Version Bump:**
* The PSReadLine module version is updated to 3.0.0 across all relevant files, reflecting the breaking changes and new requirements. (`[[1]](diffhunk://#diff-15b49bb2c4d47eeb9db538533ac5b972f85f34ba280b7acb42c1b5c27db438e9L8-R21)`, `[[2]](diffhunk://#diff-249c945874c86bf263442fb1b4ffbc108e8642a3ce9b0d05a6e1b103a7933bbeL4-R10)`)
**Development Environment Updates:**
* The VS Code launch configuration is updated to reference the new build output path for .NET 8.0. (`[.vscode/launch.jsonL17-R17](diffhunk://#diff-bd5430ee7c51dc892a67b3f2829d1f5b6d223f0fd48b82322cfd45baf9f5e945L17-R17)`)
These changes modernize PSReadLine, streamline its development and deployment, and ensure compatibility with the latest PowerShell and .NET releases.
## PR Checklist
- [ ] PR has a meaningful title
- Use the present tense and imperative mood when describing your changes
- [ ] Summarized changes
- [ ] Make sure you've added one or more new tests
- [ ] Make sure you've tested these changes in terminals that PowerShell is commonly used in (i.e. conhost.exe, Windows Terminal, Visual Studio Code Integrated Terminal, etc.)
- **User-facing changes**
- [ ] Not Applicable
- **OR**
- [ ] Documentation needed at [PowerShell-Docs](https://github.com/MicrosoftDocs/PowerShell-Docs)
- [ ] Doc Issue filed: <!-- Number/link of that issue here -->
###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/PowerShell/PSReadLine/pull/5055)
合并状态:未合并 1 条评论