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
A workaround is to ensure that ModuleA is installed, then Update-ModuleManifest won't fail.
Expected behavior
It's possible to set Required Module via Update-ModuleManifest
Actual behavior
It's not possible to set Required Module via Update-ModuleManifest, it errors with
Cannot update the manifest file 'D:\programming\pwsh/ModuleB.psd1' because the manifest is not valid. Verify that the manifest file is valid, and then try again.'The specified RequiredModules entry 'MyModule' in the module
| manifest 'D:\programming\pwsh\PSGet_ModuleB.psd1' is invalid. Try again after updating this entry with valid values.'
Error details
PS D:\programming\pwsh> Get-ErrorException : Type : System.ArgumentException Message : Cannot update the manifest properly. 'The specified RequiredModules entry 'MyModule' in the module manifest 'D:\programming\pwsh\ModuleB.psd1' is invalid. Try again after updating this entry with valid values.' TargetSite : Name : ThrowTerminatingError DeclaringType : System.Management.Automation.MshCommandRuntime, System.Management.Automation, Version=7.4.1.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35 MemberType : Method Module : System.Management.Automation.dll Source : System.Management.Automation HResult : -2147024809 StackTrace : at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)TargetObject : D:\programming\pwsh/ModuleB.psd1CategoryInfo : InvalidArgument: (D:\programming\pwsh/ModuleB.psd1:String) [Update-ModuleManifest], ArgumentExceptionFullyQualifiedErrorId : InvalidModuleManifestFile,Update-ModuleManifestInvocationInfo : MyCommand : Update-ModuleManifest ScriptLineNumber : 7 OffsetInLine : 1 HistoryId : 21 ScriptName : D:\programming\pwsh\Update-ModuleManifest_bug.ps1 Line : Update-ModuleManifest -Path:"$PSScriptRoot/ModuleB.psd1" -RequiredModules:$ModuleA Statement : Update-ModuleManifest -Path:"$PSScriptRoot/ModuleB.psd1" -RequiredModules:$ModuleA PositionMessage : At D:\programming\pwsh\Update-ModuleManifest_bug.ps1:7 char:1 + Update-ModuleManifest -Path:"$PSScriptRoot/ModuleB.psd1" -RequiredMod … + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PSScriptRoot : D:\programming\pwsh PSCommandPath : D:\programming\pwsh\Update-ModuleManifest_bug.ps1 InvocationName : Update-ModuleManifest CommandOrigin : InternalScriptStackTrace : at ThrowError, C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1: line 7115 at Update-ModuleManifest, C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1: line 13336 at <ScriptBlock>, D:\programming\pwsh\Update-ModuleManifest_bug.ps1: line 7 at <ScriptBlock>, <No file>: line 1
Environment data
Name Value
---------
PSVersion 7.4.1
PSEdition Core
GitCommitId 7.4.1
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
The text was updated successfully, but these errors were encountered:
Prerequisites
Steps to reproduce
Passing
-RequiredModules
directly toNew-ModuleManifest
works:Passing
-RequiredModules
toUpdate-ModuleManifest
fails:A workaround is to ensure that ModuleA is installed, then
Update-ModuleManifest
won't fail.Expected behavior
It's possible to set Required Module via
Update-ModuleManifest
Actual behavior
It's not possible to set Required Module via
Update-ModuleManifest
, it errors withError details
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: