vmware / powerclicore

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

build fails on enable-experimental #70

Closed brtlvrs closed 1 year ago

brtlvrs commented 1 year ago

Describe the bug

When running a docker build, it fails with the error

Enable-ExperimentalFeature: No experimental feature was found that matched the name 'PSDesiredStateConfiguration.InvokeDscResource'. WARNING: Enabling and disabling experimental features do not take effect until next start of PowerShell.

Reproduction steps

  1. clone git repository
  2. run docker build -t pwcli:test .

Expected behavior

Expected behaviour is a succesfull build.

Additional context

Workaround is to remove or comment-out the line pwsh -c "Enable-ExperimentalFeature PSDesiredStateConfiguration.InvokeDscResource" && \

nklinkachevAtVMware commented 1 year ago

The Invoke-DscResource is no longer experimental feature starting with PSDesiredStateConfiguration 2.0.6. I've added the required minimum version for this module and updated the Dokerfile. The build should work now out of the box.

brtlvrs commented 1 year ago

Yes. Sry had no time to check it until now. But it works. I've a pipeline running that replaces the FROM line, with the latest powershell image, and builds a new powerclicore image, pushes it to dockerhub... and it works... tnx