PowerShellGetv2
PowerShellGetv2 copied to clipboard
Cannot Install-Module with pre-release module dependencies.
I'm unable to install modules with prerelease dependencies despite me include -AllowPrerelease
switch to Install-Module
.
Steps to reproduce
ModuleA:
@{
ModuleVersion = '0.1.0'
GUID = '081f4c91-b4d8-441a-89e5-543859f68f2f'
PrivateData = @{
PSData = @{
Prerelease = 'preview1'
}
}
}
ModuleB:
@{
ModuleVersion = '0.1.0'
GUID = '4e54ce23-e81b-4e10-90a6-03a346085362'
RequiredModules = @('ModuleA')
PrivateData = @{
PSData = @{
Prerelease = 'preview1'
}
}
}
Both ModuleA
and ModuleB
are pre-release modules. ModuleB
depends on ModuleA
as specified in ModuleB's manifest.
- Pack both modules into nuget packges, then publish them to a repository of choice using
nuget push
. - Run
Install-Module -Name ModuleB -AllowPrerelease
.
Expected behavior
Pre-release versions of ModuleB
and its dependency ModuleA
should install successfully.
Including -AllowPrerelease
switch when executing Install-Module
should also install pre-release versions (if any) of a module's dependency.
Actual behavior
I get an error message saying:
Unable to find dependent module(s) (ModuleA)
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.2.3
PSEdition Core
GitCommitId 6.2.3
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
> Get-Module -ListAvailable PowerShellGet,PackageManagement
Name Version
---- -------
PackageManagement 1.4.5
PowerShellGet 2.2.1
Thanks for opening this issue, it is likely related to PowerShell/PowerShellGetv2#517 ...it would be helpful to know what module it is that you are trying to install? This issue will likely be fixed in the next release of PowerShellGet which we are targeting for the end of this year
@peombwa @SydneyhSmith We are seeing this same issue about unable to Install or Publish pre-release modules which depend on other pre-release modules. Is there any resolution to this? If not, what are the possible workarounds?