Giter Site home page Giter Site logo

cypher0n3 / psscriptanalyzer-docker Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 9 KB

A basic docker image based off of Microsoft's PowerShell image (https://hub.docker.com/r/microsoft/powershell/) which includes PSScriptAnalyzer (https://github.com/PowerShell/PSScriptAnalyzer) intended for use with automated CI pipelines.

License: MIT License

Dockerfile 81.55% PowerShell 18.45%
docker-image docker psscriptanalyzer gitlab-ci

psscriptanalyzer-docker's Introduction

PSScriptAnalyzer-Docker

pipeline status

A basic docker image based off of Microsoft's PowerShell image which includes PSScriptAnalyzer

Pulling

PSScriptAnalzyer-Docker can be pulled from either DockerHub:

docker pull docker.io/cypher0n3/psscriptanalyzer-docker

or GitLab:

docker pull registry.gitlab.com/cypher_zero/psscriptanalyzer-docker

Tags

latest

The latest tag is always the latest, hopefully stable, build. This tag is updated automatically every Monday based on the latest PowerShell container and stable PSScriptAnalyzer.

If the pipeline status above indicates a failure, then this image is unstable.

stable-*

These tags are known stable builds as tested by the developer. These correspond to the same tag name in the code repository. Identifying numbers correspond to the date the tag was created.

Numbered tags

Numbered tags correspond to GitLab CI pipeline IIDs and should be considered development builds. Use at your own risk.

Usage

For advanced usage of PSScriptAnalyzer modules (Invoke-ScriptAnalyzer) see: https://github.com/PowerShell/PSScriptAnalyzer.

Analyze a script on your local system

Assuming you have a directory named test in your local path which contains the scripts to test:

docker run -v ./test:/test cypher0n3/psscriptanalyzer-docker:latest "Invoke-ScriptAnalyzer -Path /test/*.ps1"

In GitLab pipeline

When running in a GitLab pipeline, override the default entry point and call pwsh -c Invoke-ScriptAnalyzer as part of the script block. This is due to the way that GitLab sets up the container, etc. See below for a working example:

psscriptanalyzer:
  image:
    name: registry.gitlab.com/cypher_zero/psscriptanalyzer-docker:latest
    entrypoint: ["/bin/bash", "-c"]
  variables:
    PS1_TESTPATH: ./test/*.ps1
  script:
    - output=$(pwsh -c "Invoke-ScriptAnalyzer -Path $PS1_TESTPATH")
    - echo "${output}"
    - |
      if [[ -n ${output} ]]; then
        echo "Failures detected; see above."
        exit 1
      fi

Contributing

Code and pipeline automation for this project is maintained in GitLab here: https://gitlab.com/cypher_zero/psscriptanalyzer-docker

Please submit all issues and merge requests via the above GitLab project. Submissions and issues from other sources (e.g. GitHub) will not be addressed.

psscriptanalyzer-docker's People

Contributors

cypher0n3 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.