RamblingCookieMonster / PSDepend

PowerShell Dependency Handler
MIT License
283 stars 76 forks source link

Add AcceptLicense for PSRepositoryModule #106

Closed awickham10 closed 4 years ago

awickham10 commented 4 years ago

Trying to use PSDepend with UniversalDashboard module, but PSRepositoryModule dependency type doesn't support AcceptLicense.

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

This PR adds in a AcceptLicense parameter to PSGalleryModule, which defaults to true.

@{
    Pester = 'latest'
    UniversalDashboard = @{
        Name = 'UniversalDashboard'
        DependencyType = 'PSGalleryModule'
        Parameters = @{
            AcceptLicense = $true
        }
        Version = '2.7'
    }
}
awickham10 commented 4 years ago

Hi @RamblingCookieMonster - any chance you could take a look at this?

RamblingCookieMonster commented 4 years ago

Shoot, please feel free to bug me, missed this. Can we make this conditionally add the parameter only if psboundparameters contains the key (i.e. no default)? I think that's generally the preferred route to avoid cases where the user doesn't end up making the call on the license?