Skip to content

New PowerShell compatibility rules#1133

Merged
JamesWTruher merged 195 commits into
PowerShell:developmentfrom
rjmholt:compatibility-rules
Feb 28, 2019
Merged

New PowerShell compatibility rules#1133
JamesWTruher merged 195 commits into
PowerShell:developmentfrom
rjmholt:compatibility-rules

Conversation

@rjmholt

@rjmholt rjmholt commented Jan 29, 2019

Copy link
Copy Markdown
Contributor

PR Summary

Resolves #805.

Adds three new rules:

  • UseCompatibleCommands: checks the compatibility of cmdlets and functions available by default with different PowerShell versions/platforms (effectively outmodes UseCompatibleCmdlets)
  • UseCompatibleTypes: checks the compatibility of types/.NET APIs available by default with different PowerShell versions/platforms
  • UseCompatibleSyntax: a simpler, by-hand rule that checks for known bad syntaxes (like [type]::new() and using module MyModule) when given PowerShell versions are targeted

The first two rules rely on profiles collected from PowerShell environments. The tools to collect this are included with the PR.

Done since opening PR

  • Fix typename serialisation in JSON
  • Add type compatibility check rule
  • Add more testing
  • Document code properly
  • Collect profiles on more platforms

PR Checklist

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rules to check compatibility with PSCore6

5 participants