I ran into this when attempting to test one of my existing module manifests and was able to reproduce it with the simpler steps below.
Steps to reproduce
> New-ModuleManifest 'test.psd1' -RootModule 'test'
> Test-ModuleManifest '.\test.psd1'
Expected behavior
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Binary 0.0.1 test
Actual behavior
Test-ModuleManifest : The module manifest 'test' could not be processed because it is not a valid PowerShell module manifest file. Remove the elements that are not permitted: C:\Users\me\test.psd1
At line:1 char:1
+ Test-ModuleManifest '.\test.psd1'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (.\test.psd1:String) [Test-ModuleManifest], ArgumentException
+ FullyQualifiedErrorId : Modules_InvalidRootModuleInModuleManifest,Microsoft.PowerShell.Commands.TestModuleManifestCommand
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.2
PSEdition Core
GitCommitId v6.0.2
OS Microsoft Windows 10.0.16299
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Note: This succeeds on Windows PSVersion 5.1.16299.251
I ran into this when attempting to test one of my existing module manifests and was able to reproduce it with the simpler steps below.
Steps to reproduce
Expected behavior
Actual behavior
Environment data
Note: This succeeds on Windows PSVersion 5.1.16299.251