vmware / powerclicore

PowerCLI Core Dockerfile
Apache License 2.0
97 stars 48 forks source link

Update PowerCLI-Example-Scripts #66

Closed DisasteR closed 1 year ago

DisasteR commented 2 years ago

Is your feature request related to a problem? Please describe.

Integrated PowerCLI-Example-Scripts modules are from 2019 and contain old scripts versions.

Describe the solution you'd like

update to latest version of PowerCLI-Example-Scripts. https://github.com/vmware/PowerCLI-Example-Scripts/archive/c74ae8cd7d65ca95a8a2cadc68afddc1455fc838.zip

Describe alternatives you've considered

No response

Additional context

No response

tenthirtyam commented 1 year ago

Hi @DisasteR and @dmilov! 👋

There are two better ways of making this change.

  1. Change the URL from a specific archive to the one generated directly from the master branch.

    Change this:

    https://github.com/vmware/powerclicore/blob/835167f44b6dc4bde8e479beceabaf480d58bb9a/Dockerfile#L22

    To this:

    curl -o ./PowerCLI-Example-Scripts.zip -J -L https://github.com/vmware/PowerCLI-Example-Scripts/archive/refs/heads/master.zip && \
  2. A better option is to simply clone the repository using git since it's already installed by the tdnf commands:

    Change this:

    https://github.com/vmware/powerclicore/blob/835167f44b6dc4bde8e479beceabaf480d58bb9a/Dockerfile#L22-L26

    To this:

    git clone https://github.com/vmware/PowerCLI-Example-Scripts.git && \
    mv ./PowerCLI-Example-Scripts/Modules/* /usr/lib/powershell/Modules/ && \

    This remove unzip from:

    https://github.com/vmware/powerclicore/blob/835167f44b6dc4bde8e479beceabaf480d58bb9a/Dockerfile#L12

    and....

    https://github.com/vmware/powerclicore/blob/835167f44b6dc4bde8e479beceabaf480d58bb9a/Dockerfile#L29

Hope this helps. Happy to put in a PR, if you like.

Ryan Johnson Staff II Solutions Architect | VMware, Inc.

tenthirtyam commented 1 year ago

@dmilov - In addition, the following could be considered:

Change: https://github.com/vmware/powerclicore/blob/835167f44b6dc4bde8e479beceabaf480d58bb9a/Dockerfile#L1

To:

FROM photon:4.0

....and....

Change this:

https://github.com/vmware/powerclicore/blob/835167f44b6dc4bde8e479beceabaf480d58bb9a/Dockerfile#L12

To this:

tdnf install -y wget tar icu powershell-7.2.0-3.ph4 git tzdata && \

Ryan Johnson Staff II Solutions Architect | VMware, Inc.