You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
Make sure you are able to repro it on the latest version
Search the existing issues.
Steps to reproduce
Having both Desktop and Core installed results in there being two versions of PackageManagement, Desktop 1.0.0.1 and Core 1.4.8.1, but Import-DscResource isn't smart enough to distinguish between editions.
I thought that perhaps it would be possible to get the version of the correct edition, but instead I'm having to hardcode 1.0.0.1 everywhere, because Import-DscResource ... -ModuleVersion has to be a constant.
PS> Configuration HailMary { Import-DscResource -ModuleName PackageManagement }ParserError:Line | 1 | … uration HailMary { Import-DscResource -ModuleName PackageManagement } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Multiple versions of the module 'PackageManagement' were found. You can run 'Get-Module -ListAvailable | -FullyQualifiedName PackageManagement' to see available versions on the system, and then use the fully | qualified name '@{ModuleName="PackageManagement"; RequiredVersion="Version"}'.
Error details
PS> Configuration HailMary { Import-DscResource -ModuleName PackageManagement }ParserError:Line | 1 | … uration HailMary { Import-DscResource -ModuleName PackageManagement } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Multiple versions of the module 'PackageManagement' were found. You can run 'Get-Module -ListAvailable | -FullyQualifiedName PackageManagement' to see available versions on the system, and then use the fully qualified | name '@{ModuleName="PackageManagement"; RequiredVersion="Version"}'.10/31/2022 15:37:56 [C:\Users\oliver]Win|PS> get-errorType : System.Management.Automation.ParseExceptionErrors : Extent : Import-DscResource -ModuleName PackageManagement ErrorId : MultipleModuleEntriesFoundDuringParse Message : Multiple versions of the module 'PackageManagement' were found. You can run 'Get-Module -ListAvailable-FullyQualifiedName PackageManagement' to see available versions on the system, and then use the fully qualified name'@{ModuleName="PackageManagement"; RequiredVersion="Version"}'.Message : At line:1 char:26 + … uration HailMary { Import-DscResource -ModuleName PackageManagement } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Multiple versions of the module 'PackageManagement' were found. You can run 'Get-Module -ListAvailable-FullyQualifiedName PackageManagement' to see available versions on the system, and then use the fully qualified name'@{ModuleName="PackageManagement"; RequiredVersion="Version"}'.ErrorRecord : Exception : Type : System.Management.Automation.ParentContainsErrorRecordException Message : At line:1 char:26 + … uration HailMary { Import-DscResource -ModuleName PackageManagement } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Multiple versions of the module 'PackageManagement' were found. You can run 'Get-Module-ListAvailable -FullyQualifiedName PackageManagement' to see available versions on the system, and then use the fullyqualified name '@{ModuleName="PackageManagement"; RequiredVersion="Version"}'. HResult : -2146233087 CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException FullyQualifiedErrorId : MultipleModuleEntriesFoundDuringParse InvocationInfo : ScriptLineNumber : 1 OffsetInLine : 26 HistoryId : -1 Line : Configuration HailMary { Import-DscResource -ModuleName PackageManagement } PositionMessage : At line:1 char:26 + … uration HailMary { Import-DscResource -ModuleName PackageManagement } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CommandOrigin : InternalTargetSite : Name : Invoke DeclaringType : System.Management.Automation.Runspaces.PipelineBase, System.Management.Automation,Version=7.2.7.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35 MemberType : Method Module : System.Management.Automation.dllSource : System.Management.AutomationHResult : -2146233087StackTrace : at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.Runspaces.Pipeline.Invoke() at Microsoft.PowerShell.Executor.ExecuteCommandHelper(Pipeline tempPipeline, Exception& exceptionThrown,ExecutionOptions options)
Environment data
PS>$PSVersionTable
Name Value
---------
PSVersion 7.2.7
PSEdition Core
GitCommitId 7.2.7
OS Microsoft Windows 10.0.22000
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
PS>$PSVersionTable
Name Value
---------
PSVersion 5.1.22000.832
PSEdition Desktop
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
BuildVersion 10.0.22000.832
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version
7.2.7
Visuals
No response
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Prerequisites
Steps to reproduce
Having both Desktop and Core installed results in there being two versions of PackageManagement, Desktop 1.0.0.1 and Core 1.4.8.1, but Import-DscResource isn't smart enough to distinguish between editions.
I thought that perhaps it would be possible to get the version of the correct edition, but instead I'm having to hardcode 1.0.0.1 everywhere, because
Import-DscResource ... -ModuleVersion
has to be a constant.Expected behavior
Actual behavior
Error details
Environment data
Version
7.2.7
Visuals
No response
The text was updated successfully, but these errors were encountered: