Can't publish new PowerShell binary module as it can't find the module

Will Pittenger 306 Reputation points
2025-02-15T08:40:31.4433333+00:00

I'm trying to publish a new module to the PowerShell Gallery with publish-Module -name WillPittenger.Goodies.PowerShell.JSON -Repository PSGallery -NuGetApiKey ~~_____~~. I'm getting the error "Publish-Module: The specified module 'WillPittenger.Goodies.PowerShell.JSON' was not published because no module with that name was found in any module directory." What's going on? I tried making the current directory the bin/release/.Net9.0 folder and bin/release/.Net9.0/WillPittenger.Goodies.PowerShell.JSON folder. Neither worked. Does the module need to be installed before I can publish?

If I give it the psd1, it reports different errors as shown below even though I can import the module successfully:

Test-ModuleManifest: The specified ModuleList entry 'WillPittenger.Goodies.JSON.dll' in the module manifest
'C:\Users\willp\AppData\Local\Temp\1681295768\WillPittenger.Goodies.PowerShell.JSON\WillPittenger.Goodies.PowerShell.JSO
N.psd1' is invalid. Try again after updating this entry with valid values.
Test-ModuleManifest: The specified ModuleList entry 'WillPittenger.Goodies.PowerShell.JSON.dll' in the module manifest
'C:\Users\willp\AppData\Local\Temp\1681295768\WillPittenger.Goodies.PowerShell.JSON\WillPittenger.Goodies.PowerShell.JSO
N.psd1' is invalid. Try again after updating this entry with valid values.
Test-ModuleManifest: The specified ModuleList entry 'WillPittenger.Goodies.Tools.dll' in the module manifest
'C:\Users\willp\AppData\Local\Temp\1681295768\WillPittenger.Goodies.PowerShell.JSON\WillPittenger.Goodies.PowerShell.JSO
N.psd1' is invalid. Try again after updating this entry with valid values.

The project is WillPittenger.Goodies.JSON. Below is my directory structure.

PS B:\Contents\Will Pittenger\Goodies\PowerShell\WillPittenger.Goodies.PowerShell.JSON\bin\Release\net9.0> dir .\WillPittenger.Goodies.PowerShell.JSON\
    Directory: B:\Contents\Will Pittenger\Goodies\PowerShell\WillPittenger.Goodies.PowerShell.JSON\bin\Release\net9.0\W
illPittenger.Goodies.PowerShell.JSON
Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---           1-31-2025 11:55 PM          12288 WillPittenger.Goodies.JSON.dll
-a---           1-31-2025 11:55 PM          10240 WillPittenger.Goodies.PowerShell.JSON.dll
-a---           1-31-2025 10:52 PM           8044 WillPittenger.Goodies.PowerShell.JSON.psd1
-a---           1-31-2025 11:55 PM          11264 WillPittenger.Goodies.Tools.dll

Here is the psd1.

#
# Module manifest for module 'Org.WillPittenger.PowerShell.Tools.Sounds'
#
# Generated by: Will Pittenger
#
# Generated on: 11-17-2021 7:27:43 pm
#

@{
	# Script module or binary module file associated with this manifest.
	RootModule = 'WillPittenger.Goodies.PowerShell.JSON.dll'

	# Version number of this module.
	ModuleVersion = '0.5.0';

	# ID used to uniquely identify this module
	GUID = '9a4b7d3e-f9b2-4500-923f-236932b3e86d';

	# Author of this module
	Author = 'Will Pittenger';

	# Company or vendor of this module
	CompanyName = '';

	# Copyright statement for this module
	Copyright = 'Copyright ©2025, . All rights reserved.';

	# Description of the functionality provided by this module
	Description = 'Converts from JSON, but unlike the stock ConvertFrom-JSON, the output object contains sorted fields.'

	# Minimum version of the Windows PowerShell engine required by this module
	#PowerShellVersion = '5.1.19041.1682';

	# Name of the Windows PowerShell host required by this module
	#PowerShellHostName = '';

	# Minimum version of the Windows PowerShell host required by this module
	#PowerShellHostVersion = '';

	# Minimum version of the .NET Framework required by this module
	#DotNetFrameworkVersion = '6.0';

	# Minimum version of the common language runtime (CLR) required by this module
	#CLRVersion = '4.0.30319.42000';

	# Processor architecture (None, X86, Amd64) required by this module
	#ProcessorArchitecture = '';

	# Modules that must be imported into the global environment prior to importing this module
	RequiredModules = 
	@(
	);

	# Assemblies that must be loaded prior to importing this module
	RequiredAssemblies =
	@(
	);

	# Script files (.ps1) that are run in the caller's environment prior to importing this module.
	#ScriptsToProcess =
	#@(
	#);

	# Type files (.ps1xml) to be loaded when importing this module
	#TypesToProcess =
	#@(
	#);

	# Format files (.ps1xml) to be loaded when importing this module
	#FormatsToProcess =
	#@(
	#);

	# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
	NestedModules =
	@(
	);

	# Functions to export from this module
	FunctionsToExport =
	@(
		'ConvertFrom-JSON'
	);

	# Cmdlets to export from this module
	CmdletsToExport =
	@(
		'ConvertFrom-JSON'
	);

	# Variables to export from this module
	VariablesToExport =
	@(
	);

	# Aliases to export from this module
	AliasesToExport =
	@(
	);

	# List of all modules packaged with this module.
	ModuleList =
	@(
		'WillPittenger.Goodies.JSON.dll',
		'WillPittenger.Goodies.PowerShell.JSON.dll',
		'WillPittenger.Goodies.Tools.dll'
	);

	# List of all files packaged with this module
	FileList = 
	@(
	);

	# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
	PrivateData = @{
			PSData = @{
					# Tags applied to this module. These help with module discovery in online galleries.
					Tags =
					@(
						"Windows",
						"JSON",
						"Converter",
						"Conversion",
						".NET"
					);

					# A URL to the license for this module.
					LicenseUri = 'https://licenses.nuget.org/LGPL-3.0-or-later';

					# A URL to the main website for this project.
					ProjectUri = 'https://github.com/WillPittenger/Goodies/tree/master/PowerShell/WillPittenger.Goodies.PowerShell.JSON';

					# A URL to an icon representing this module.
					IconUri = 'https://sourceforge.net/projects/org-willpittenger-tools-sounds/files/Images/Icon%2064x64.png/download';

					# ReleaseNotes of this module
					# ReleaseNotes = '';

			}; # End of PSData hashtable

	}; # End of PrivateData hashtable

	# HelpInfo URI of this module
	#HelpInfoURI = ''

	# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
	DefaultCommandPrefix = '';
};
.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,105 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,296 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,751 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,811 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Will Pittenger 306 Reputation points
    2025-02-15T09:33:24.65+00:00

    chrisdent on Discord told me what I did wrong. See the changes on FIxed psd1 files based on comments from chrisdent on Discord.. It's now working.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.