RamblingCookieMonster / PSDepend

PowerShell Dependency Handler
MIT License
285 stars 76 forks source link

Following examples gives errors #20

Closed Plork closed 7 years ago

Plork commented 7 years ago

I followed the example config

PSDepend/Examples/VirtualEnvironment.md.

When I add the following block:

    PSDependOptions = @{
        Target = '$DependencyFolder'
        AddToPath = $True
        Parameters = @{
            Force = $True
        }
    }

I get: WARNING: Parameter [Force] with value [True] is not a valid parameter for [PSGalleryModule], ignoring. Valid params: [Dependency Import PSDependAction Repository]

So might be useful to define parameter blocks per DependencyType or state that the parameters must match across all dependency types.

RamblingCookieMonster commented 7 years ago

Hi!

Thanks for the note - yeah, rejigged the behavior to not require force to create target folders, forgot to fix the examples, added to TODO list!

As is, we basically query parameters for a script, and ignore any user defined parameters that aren't valid, giving a warning instead - i.e. it should theoretically still work, it will just throw warnings.

A global parameter block per dependency type... interesting idea. Might be some fun logic to put together, but that would avoid this situation, offer granularity in between global and per-dependency.

Cheers!

RamblingCookieMonster commented 7 years ago

Fixed this and a few other examples - thanks again for the heads up!

Closing this out - if you want to open a separate issue for the feature idea (parameter blocks per dependency type), feel free, definitely a good idea.

Cheers!