Closed
Description
Hi!
Apologies if this is a duplicate.
Let's pretend I have a module. Or function. Or script. I want it to work on PowerShell Core in OS X.
Current state: I have two options that seem readily available:
- Read docs. Read code. Test things. Adjust things. Repeat ad nauseam.
- Spend money. Tobias provides helpful functionality in ISESteroids.
Desired state:
- A free, ideally open source tool to analyze code, identify .NET / language / other compatibility issues depending on the PSEdition (e.g. Core), and OS (e.g. OS X).
Ideally, on top of identifying incompatible code, provide suggested alternatives or references in the rules 'Message'.
Why:
- Community members may not have the time or money to ensure PowerShell Core compatibility for their modules/functions/scripts
- This might help build the limited library of core-compatible PowerShell modules. Presumably, open source folks may be more likely to use a language and write modules for it if they have access to existing libraries/modules
- Tooling like this could be used in CI/CD pipelines, perhaps as a fast-fail prior to spinning up tests on Core (e.g. test with PowerShell "full", run this tool, if it fails, don't spin up PowerShell Core env for further testing)
- I'm dreading reviewing my prior work. I need something semi-automated so that I don't see my old code and remember how sloppy it is : )
Edit: Credit to @joeyaiello who mentioned there might be plans to do this via PSScriptAnalyzer, just wanted to highlight that this will be a very valuable solution for the community (IMHO) .
Cheers!