Skip to content

Feature request: Analyze code for PSEdition and OS compatibility #605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RamblingCookieMonster opened this issue Aug 25, 2016 · 4 comments
Closed
Assignees
Milestone

Comments

@RamblingCookieMonster
Copy link

RamblingCookieMonster commented Aug 25, 2016

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!

@Knele83
Copy link

Knele83 commented Aug 25, 2016

On Thu, Aug 25, 2016 at 4:38 PM +0200, "Warren F." <[email protected]mailto:[email protected]> wrote:

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 ISESteroidshttp://www.powertheshell.com/powershellonlinux/.

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 : )

Cheers!

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/605, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFaITpT1u8zZoFqyoo1e_C1MN3UifVAiks5qjajGgaJpZM4JtJAU.

@kilasuit
Copy link
Contributor

+1 on this as I really don't want to go through all my old code and look at won't work. Perhaps there is something already out there for the comparisons of Full fat .NET to what is included in .NET Core that could be simply wrapped into a PSScriptAnalyzer

@Knele83
Copy link

Knele83 commented Aug 25, 2016

On Thu, Aug 25, 2016 at 4:48 PM +0200, "Ryan Yates" <[email protected]mailto:[email protected]> wrote:

+1 on this as I really don't want to go through all my old code and look at won't work. Perhaps there is something already out there for the comparisons of Full fat .NET to what is included in .NET Core that could be simply wrapped into a PSScriptAnalyzer

You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com//issues/605#issuecomment-242415512, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFaITgNiDQz-HB5JIc6ayRbZsQD4xbbbks5qjas_gaJpZM4JtJAU.

@kilasuit
Copy link
Contributor

One Rule that we should look at implementing will have to coincide with whatever is decided in the Weak Aliases RFC - PowerShell/PowerShell-RFC#16

My Suggestion would be to Create a Rule for curl & wget aliases and bump the severity to Error to help with possible auto scanning existing script repositories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants