Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Publish-Module doesn't report error but fails to publish module #316

Closed
@TylerLeonhardt

Description

@TylerLeonhardt

I was attempting to publish a module to the Gallery via:

Publish-Module -Name Polaris -NuGetApiKey $apiKey

The cmdlet reports nothing back - so I assume it worked. I check the Gallery to see if it did and can't find my published module anywhere, unfortunately.

I thought it was because I was publishing on a mac... but I was able to repro on Windows too with the latest version of PowerShellGet.

Expected Behavior

The module is published

Current Behavior

It silently fails... Verbose logging shows:

VERBOSE: Acquiring providers for assembly: /Users/tylerleonhardt/.powershell-daily/Modules/PackageManagement/1.1.7.0/coreclr/netcoreapp2.0/Microsoft.PackageManagement.NuGetProvider.dll
VERBOSE: Acquiring providers for assembly: /Users/tylerleonhardt/.powershell-daily/Modules/PackageManagement/1.1.7.0/coreclr/netcoreapp2.0/Microsoft.PackageManagement.CoreProviders.dll
VERBOSE: Acquiring providers for assembly: /Users/tylerleonhardt/.powershell-daily/Modules/PackageManagement/1.1.7.0/coreclr/netcoreapp2.0/Microsoft.PackageManagement.ArchiverProviders.dll
VERBOSE: Acquiring providers for assembly: /Users/tylerleonhardt/.powershell-daily/Modules/PackageManagement/1.1.7.0/coreclr/netcoreapp2.0/Microsoft.PackageManagement.MetaProvider.PowerShell.dll
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2/'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2/'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Publish Location:'https://www.powershellgallery.com/api/v2/package/'.
VERBOSE: Module 'Polaris' was found in '/Users/tylerleonhardt/Downloads/Polaris'.
VERBOSE: Loading module from path '/var/folders/rg/g30_83v14m10px9z72kydv1m0000gn/T/238330691/Polaris/Public/New-ScriptblockCallback.ps1'.
VERBOSE: Loading module from path '/var/folders/rg/g30_83v14m10px9z72kydv1m0000gn/T/238330691/Polaris/lib/MimeTypes.Class.ps1'.
VERBOSE: Loading module from path '/var/folders/rg/g30_83v14m10px9z72kydv1m0000gn/T/238330691/Polaris/lib/PolarisRequest.Class.ps1'.
VERBOSE: Loading module from path '/var/folders/rg/g30_83v14m10px9z72kydv1m0000gn/T/238330691/Polaris/lib/PolarisResponse.Class.ps1'.
VERBOSE: Loading module from path '/var/folders/rg/g30_83v14m10px9z72kydv1m0000gn/T/238330691/Polaris/lib/PolarisMiddleware.Class.ps1'.
VERBOSE: Loading module from path '/var/folders/rg/g30_83v14m10px9z72kydv1m0000gn/T/238330691/Polaris/lib/Polaris.Class.ps1'.
VERBOSE: Loading module from path '/var/folders/rg/g30_83v14m10px9z72kydv1m0000gn/T/238330691/Polaris/Polaris.psm1'.
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2/'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : 'PSGallery'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2/items/psscript/' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/items/psscript/FindPackagesById()?id='Polaris'' for ''.
VERBOSE: Total package yield:'0' for the specified package 'Polaris'.
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2/'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : 'PSGallery'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2/' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='Polaris'' for ''.
VERBOSE: Total package yield:'0' for the specified package 'Polaris'.
VERBOSE: Performing the operation "Publish-Module" on target "Version '0.1.0' of module 'Polaris'".
VERBOSE: Successfully published module 'Polaris' to the module publish location 'https://www.powershellgallery.com/api/v2/package/'. Please allow few minutes for 'Polaris' to show up in the search results.

The last line particularly strange:

VERBOSE: Successfully published module 'Polaris' to the module publish location 'https://www.powershellgallery.com/api/v2/package/'. Please allow few minutes for 'Polaris' to show up in the search results.

I would have expected the url to be https://www.powershellgallery.com/api/v2/package/ but maybe not.

Possible Solution

Not sure.

Steps to Reproduce (for bugs)

  1. Update to latest PowerShellGet
  2. Publish-Module -Name Polaris -NuGetApiKey $apiKey

Context

Can't publish my module at all :(

Your Environment

> $PSVersionTable
# on Mac I'm using a daily build

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.0-preview.10712
PSEdition                      Core
GitCommitId                    6.1.0-preview.10712
OS                             Darwin 18.0.0 Darwin Kernel Version 18.0.0: Sun Aug 12 14:04:39 PDT 2018; root:xnu-4903.201.1~14/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

# on Windows I tried both 6.1.0-Preview.2 and Windows PowerShell.

> Get-Module -ListAvailable PowerShellGet,PackageManagement

Get-Module -ListAvailable PowerShellGet,PackageManagement


    Directory: /usr/local/share/powershell/Modules


ModuleType Version    Name                                PSEdition ExportedCommands
---------- -------    ----                                --------- ----------------
Script     1.6.7      PowerShellGet                       Desk      {Find-Command, Find-DSCResource, Find-Module, Find-RoleCapability...}
Script     1.6.0      PowerShellGet                       Desk      {Install-Module, Find-Module, Save-Module, Update-Module...}


    Directory: /Users/tylerleonhardt/.powershell-daily/Modules


ModuleType Version    Name                                PSEdition ExportedCommands
---------- -------    ----                                --------- ----------------
Script     1.1.7.0    PackageManagement                   Desk      {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource...}
Script     1.6.0      PowerShellGet                       Desk      {Install-Module, Find-Module, Save-Module, Update-Module...}

> Get-PackageProvider

Name                     Version          DynamicOptions
----                     -------          --------------
NuGet                    2.8.5.210        Destination, ExcludeVersion, Scope, SkipDependencies, Headers, FilterOnTag, Contains, AllowPrereleaseVersions, ConfigFil...
PowerShellGet            1.6.7.0          PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, InstallUpdate, NoPathUpdate, AllowPrereleaseVe...

> Get-PackageProvider -ListAvailable

Name                     Version          DynamicOptions
----                     -------          --------------
Gist                     1.6.0.0
NuGet                    2.8.5.210        Destination, ExcludeVersion, Scope, SkipDependencies, Headers, FilterOnTag, Contains, AllowPrereleaseVersions, ConfigFil...
PowerShellGet            1.6.7.0          PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, InstallUpdate, NoPathUpdate, AllowPrereleaseVe...
PowerShellGet            1.6.0.0
TSD                      0.2.0.0          Destination

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions