diff --git a/technologies/job/powershell/Dockerfile b/technologies/job/powershell/Dockerfile new file mode 100644 index 0000000..ddf8066 --- /dev/null +++ b/technologies/job/powershell/Dockerfile @@ -0,0 +1,10 @@ +FROM mcr.microsoft.com/powershell:ubuntu-22.04 + +ENV POWERSHELL_TELEMETRY_OPTOUT="1" + +COPY resources/entrypoint.sh /entrypoint.sh +RUN chmod 755 /entrypoint.sh + +WORKDIR /sandbox + +CMD ["/bin/bash", "-c", "/entrypoint.sh"] diff --git a/technologies/job/powershell/README.md b/technologies/job/powershell/README.md new file mode 100644 index 0000000..50b55dc --- /dev/null +++ b/technologies/job/powershell/README.md @@ -0,0 +1,9 @@ +# Powershell + +PowerShell is a task automation and configuration management program from Microsoft, +consisting of a command-line shell and the associated scripting language. + +## Usage + +Inside this image, the default shell used is sh. You can use the `pwsh` command to run PowerShell scripts. +If a zip is uploaded, it will be automatically extracted and you can use the `pwsh` command to run your script directly. diff --git a/technologies/job/powershell/metadata.yaml b/technologies/job/powershell/metadata.yaml new file mode 100644 index 0000000..1e5a40c --- /dev/null +++ b/technologies/job/powershell/metadata.yaml @@ -0,0 +1,30 @@ +version: "v1" +type: JOB +id: powershell +label: Powershell +description: Powershell description +available: true +iconPath: powershell.png +contexts: + - id: powershell + label: powershell + available: true + recommended: true + trustLevel: experimental + job: + features: + - type: COMMAND_LINE + label: Command line + mandatory: true + comment: powershell + defaultValue: pwsh {file} + - type: ARTIFACT + label: Powershell script to execute + mandatory: false + comment: "Compatible upload file : powershell executable file or zip folder" + - type: SCHEDULER + label: Scheduled + mandatory: true + dockerInfo: + image: saagie/powershell + version: ubuntu-22.04 diff --git a/technologies/job/powershell/powershell.png b/technologies/job/powershell/powershell.png new file mode 100644 index 0000000..bb0487d Binary files /dev/null and b/technologies/job/powershell/powershell.png differ diff --git a/technologies/job/powershell/resources/entrypoint.sh b/technologies/job/powershell/resources/entrypoint.sh new file mode 100644 index 0000000..04d73de --- /dev/null +++ b/technologies/job/powershell/resources/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail + +if compgen -G "*.zip*" > /dev/null; +then + echo "Zip file detected ... unzipping ..." + unzip -q *.zip +fi + +if test -f main_script; +then sh ./main_script; +else exec "$@" +fi; diff --git a/version.properties b/version.properties index 18c7ae1..bac0d75 100644 --- a/version.properties +++ b/version.properties @@ -1,6 +1,6 @@ -version.buildmeta= +version.buildmeta=feature/powershell version.major=0 version.minor=95 version.patch=0 -version.prerelease= -version.semver=0.95.0 +version.prerelease=BETA +version.semver=0.95.0-BETA+feature/powershell