PowerShell / PowerShellGet

This module provide functions used with PowerShellGet v3 to provide compatibility with scripts expecting PowerShellGet v2
MIT License
49 stars 13 forks source link

Reverse logic for AllowClobber and SkipPublisherCheck in proxy cmdlets #36

Closed sdwheeler closed 9 months ago

sdwheeler commented 1 year ago

Summary of the new feature / enhancement

Install-Module has the AllowClobber parameter, but the proxy cmdlet discards the parameter. Install-PSResource has the NoClobber parameter.

The Install-Module default behavior prevents clobber and runs Authenticode check. The Install-PSResource default behavior allows clobber and skips Authenticode check.

The two cmdlets have opposite logic for handling these parameters.

Proposed technical implementation details (optional)

$PSBoundParameters['NoClobber'] = $true
if ( $PSBoundParameters['AllowClobber'] )    { $null = $PSBoundParameters.Remove('AllowClobber'); $PSBoundParameters['NoClobber'] = (-not $AllowClobber) }

$PSBoundParameters['AuthenticodeCheck'] = $true
if ( $PSBoundParameters['SkipPublisherCheck'] ) { $null = $PSBoundParameters.Remove('SkipPublisherCheck'); $PSBoundParameters['AuthenticodeCheck'] = (-not $SkipPublisherCheck) }