Skip to content

Test-ModuleManifest fails on manifest from New-ModuleManifest #6676

@jwittner

Description

@jwittner

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-AnsweredThe question is answered.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions