gaelcolas / Sampler

Module template with build pipeline and examples, including DSC elements.
MIT License
171 stars 42 forks source link

A parameter with the name 'ProgressAction' was defined multiple times for the command #449

Closed johlju closed 12 months ago

johlju commented 12 months ago

Problem description

After installing PowerShell 7.4.0 i getting this error on macOS when trying to resolve dependencies for the project DnsServerDsc.

Verbose logs

[pre-build] Starting Build Init
[pre-build] Pre-pending '/Users/johlju/source/DnsServerDsc/output/RequiredModules' folder to PSModulePath
[pre-build] Pre-pending '/Users/johlju/source/DnsServerDsc/output' folder to PSModulePath
[pre-build] Resolving dependencies.
[pre-build] Starting bootstrap process.
[build] Starting build with InvokeBuild.                                                                                
MetadataError: /Users/johlju/source/DnsServerDsc/build.ps1:494
Line |
 494 |          Invoke-Build @PSBoundParameters -Task $Tasks -File $MyInvocat …
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | A parameter with the name 'ProgressAction' was defined multiple times for the command.

How to reproduce

Run the command

./build.ps1 -ResolveDependency -Tasks noop

Expected behavior

Build to be successful.

Current behavior

Build fails with an exception.

Suggested solution

Unknown

Operating system the target node is running

PS > sw_vers                                
ProductName:        macOS
ProductVersion:     14.1.1
BuildVersion:       23B81

PowerShell version and build the target node is running

Name                           Value
----                           -----
PSVersion                      7.4.0
PSEdition                      Core
GitCommitId                    7.4.0
OS                             Darwin 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct  9 21:27:27 PDT 2023; root:xnu-10002.41.9~6/R…
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module version used

0.117.0
johlju commented 12 months ago

Had nothing to do with PowerShell 7.4. There were a lot of old versions of modules in the required modules folder. After removing the folder and restarting the PS session the task finished successfully.

Since there were an addition of ProgressAction in PS 7.4 I thought that could have something to do with it, but no. 🙂