Search notes:

PowerShell cmdLet Publish-Module

nuget.exe is required

PS: 19 C:\> publish-module -path path/to/module -nuGetApiKey ‥

NuGet.exe is required to continue
PowerShellGet requires NuGet.exe to publish an item to the NuGet-based repositories. NuGet.exe must be available in 'C:\ProgramData\Microsoft\Windows\PowerShell\PowerShellGet\' or 'C:\Users\igsnyre\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\, or under one of the paths specified in PATH environment
variable value. NuGet.exe can be downloaded from https://nuget.org/nuget.exe. Do you want PowerShellGet to install NuGet.exe now?

Adding .nuspec

When a module is published, a .nuspec file is added.

Could not create SSL/TLS secure channel

PS: C:\> publish-module -name rene.wsb -NuGetApiKey $env:nugetApiKey
Publish-PSArtifactUtility : Failed to publish module 'Rene.wsb': 'The request was aborted: Could not create SSL/TLS secure channel.
Running the following commands as administrator helped circumvent the above error, after starting a new Powershell session (see here).
install-module PowerShellGet                      -repository PSGallery -force -allowClobber
install-module Microsoft.PowerShell.PSResourceGet -repository PSGallery -force

Failed to generate the compressed file for module 'C:\Program Files\dotnet\dotnet.exe failed to pack: error

After "fixing" the above error, I then got this:
PS: C:\> publish-module -name rene.wsb -NuGetApiKey $env:nugetApiKey
Publish-PSArtifactUtility : Failed to generate the compressed file for module 'C:\Program Files\dotnet\dotnet.exe failed to pack: error
I was able to "fix" this error by executing the following command and then starting a new powershell session.
invoke-webRequest -uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -outFile "$env:LOCALAPPDATA\Microsoft\Windows\PowerShell\PowerShellGet\NuGet.exe"

See also

publish-script
Powershell command noun: module

Index