You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Build Microsoft.PowerShell.CrossCompatibility for net8 like Engine and Rules #2300
Since #2073, Engine and Rules target net8;net462 and compile against System.Management.Automation 7.4. Microsoft.PowerShell.CrossCompatibility, which Rules references, still targets netstandard2.0;net462 and compiles against PowerShellStandard.Library 5.1.1 for the Core build.
This has two effects:
PowerShellStandard.Library flows from CrossCompatibility into Rules, next to System.Management.Automation 7.4, so Rules gets two reference assemblies for System.Management.Automation. It only works because the SDK's conflict resolution picks the higher assembly version.
Building PSScriptAnalyzer needs PowerShellStandard.Library just for this one project.
The netstandard2.0 build lets PSCompatibilityCollector load on any PowerShell 6 or newer. Every supported PowerShell 7 is 7.4 or newer, which runs a net8 build, and the shipped profiles were last collected for PowerShell 7.0 (#1429).
PSCompatibilityCollector.psm1 and PSCompatibilityCollector/build.ps1: netstandard2.0 becomes net8.
Directory.Packages.props: drop PowerShellStandard.Library.
The collector would then need PowerShell 7.4 or newer on Core. Windows PowerShell keeps the net462 build.
If you'd rather keep netstandard2.0, PrivateAssets="all" on the PowerShellStandard.Library reference would at least keep it from flowing into Rules, as it's only needed for compiling.
I can open a PR for either.
What is the latest version of PSScriptAnalyzer at the point of writing
Activity