The Save-Module command fails using 1.1.7 of the PackageManagement module and saving the module to a specific path.
Expected Behavior
I expect to be able to save a module to a specific path.
Current Behavior
I get this error and no module is installed:
$ Save-Module -Name Pester -Path .output
Save-Package : A parameter cannot be found that matches parameter name 'AllowPrereleaseVersions'.
At C:\Build\Whiskey\Whiskey\PowerShellGet\PSModule.psm1:1836 char:52
+ $null = PackageManagement\Save-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Save-Package], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.PackageManagement.Cmdlets.SavePackage
Possible Solution
The Save-Package command has five parameter sets, but only two of them have the AllowPrereleaseVersions. It doesn't look like any command that takes a name and path accept the AllowPrereleaseVersions switch. Call the correct parameter set with the correct parameters, or update the PackageManagement module to always allow the AllowPrereleaseVersions parameter set.
We can't use Save-Module to download and install local copies of a module to a repository (similar to how NuGet packes and Node modules get installed into packages and node_modules directories inside a repository that uses it).
We can get past this issue by never passing AllowPrereleaseVersions to Save-Package, but then we lose the ability to install prerelease modules.
The Save-Module command fails using 1.1.7 of the PackageManagement module and saving the module to a specific path.
Expected Behavior
I expect to be able to save a module to a specific path.
Current Behavior
I get this error and no module is installed:
Possible Solution
The
Save-Package
command has five parameter sets, but only two of them have theAllowPrereleaseVersions
. It doesn't look like any command that takes a name and path accept theAllowPrereleaseVersions
switch. Call the correct parameter set with the correct parameters, or update the PackageManagement module to always allow theAllowPrereleaseVersions
parameter set.Steps to Reproduce (for bugs)
Context
We can't use
Save-Module
to download and install local copies of a module to a repository (similar to how NuGet packes and Node modules get installed into packages and node_modules directories inside a repository that uses it).We can get past this issue by never passing
AllowPrereleaseVersions
toSave-Package
, but then we lose the ability to install prerelease modules.Your Environment