PowerShell / PowerShellGallery

228 stars 65 forks source link

Attempt to publish module to PowerShellGallery fails, with newly created Key #98

Closed plastikfan closed 1 year ago

plastikfan commented 4 years ago

I'm trying to publish my first Module with Publish-Module to the gallery., and am getting a 403 response:

Write-Error: C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:10946 Line | 10946 | … Publish-PSArtifactUtility @PublishPSArtifactUtility_Param … | ~~~~~~~~~~~~~ | Failed to publish module 'Krayola': 'nuget.exe failed to push Response status code does not indicate success: 403 (The specified API key is invalid, has expired, or does not have | permission to access the specified package.). '.

My locally defined repository is to PowerShellGallery:

PS C:\Users\Plastikfan\dev\github\ps\Krayola> Get-PSRepository

Name InstallationPolicy SourceLocation


PSGallery Untrusted https://www.powershellgallery.com/api/v2

I've just created the key in my account, it has a name: PlastikfanKey, do I have to link this with the Publish command somehow. There is not enough information for me to fix this. Please can you assist.

What am I getting wrong?

I've been working from this documentation: https://docs.microsoft.com/en-us/powershell/module/powershellget/publish-module?view=powershell-7

Actually, when I specify the name of the module, "Krayola", does this need to be preceded by my username, ie Plastikfan.Krayola?

plastikfan commented 4 years ago

I can provide more information but this just provokes more questions from me. The name of my module is Krayola, my user name is Plastikfan. There is a Krayola.psm1 and Krayola.psd1 file inside the Krayola module folder.

When I look at the key (PlastikfanKey), it has been created with a Glob pattern Plaskikfan.*.

So does this mean, that as it is, it does not apply to Krayola? And does that mean the module Krayola has to be called Plastikfan.Krayola? IE, is the glob pattern directing the name of the module or when I publish, do I specify Plastikfan.Krayola as the name of the module? And does that mean, to install it, a client would have t run install-module Plastikfan.Krayola instead of what I assumed was just Krayola? On disk, I still want the Module name to be Krayola, having a module folder name, Plastikfan.Krayola seems wrong, but is this what I have to do?

Still confused!

plastikfan commented 4 years ago

... and here is the verbose log with Whatif:

VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; IsRegistered = 'True'. VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; IsRegistered = 'True'. VERBOSE: Publish Location:'https://www.powershellgallery.com/api/v2/package/'. VERBOSE: Module 'Krayola' was found in 'C:\Users\Plastikfan\Documents\PowerShell\Modules\Krayola'. VERBOSE: Loading module from path 'C:\Users\Plastikfan\AppData\Local\Temp\454340782\Krayola\Krayola.psm1'. VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; 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='Krayola'' for ''. VERBOSE: Total package yield:'0' for the specified package 'Krayola'. VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; 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='Krayola'' for ''. VERBOSE: Total package yield:'0' for the specified package 'Krayola'. What if: Performing the operation "Publish-Module" on target "Version '0.0.1' of module 'Krayola'". PS C:\Users\Plastikfan\dev\github\ps\Krayola>

bergmeister commented 4 years ago

@plastikfan When you created the key here, did you grant it access to push new packages by ticking the push radio button and one of the two checkboxes?

image

plastikfan commented 4 years ago

Hi again @bergmeister , yes I did: "Push new packages and package versions" is what appears next to the key.

Is this issue not related to the glob prefix?

bergmeister commented 4 years ago

@plastikfan How to you call Publish-Module (please replace the actual key value with a variable like e.g. $keyValue)? Also, what is your working directory (if you don't use the parameter set with -Path, it assumes the current working directory I think)?

plastikfan commented 4 years ago

I thought the publish command published from its registered install location so I haven't been specifying the path:

Publish-Module -Name Krayola -NuGetApiKey \<KEY>

and since its registered at: C:\Users\Plastikfan\Documents\PowerShell\Modules\Krayola, this is where I thought it published from. I've been following the msdn documentation for Publish-Module

PS C:\Users\Plastikfan\dev\github\ps\Krayola> Get-Module Krayola | fl

Name              : Krayola
Path              : C:\Users\Plastikfan\Documents\PowerShell\Modules\Krayola\Krayola.psm1
Description       : Colourful console writing with Powershell
ModuleType        : Script
Version           : 0.0.1
PreRelease        :
NestedModules     : {}
ExportedFunctions : {Show-ConsoleColours, Write-InColour, Write-RawPairsInColour, Write-ThemedColouredPairs}
ExportedCmdlets   :
ExportedVariables : KrayolaThemes
ExportedAliases   : {Show-ConsoleColors, Write-InColor, Write-RawPairsInColor, Write-ThemedColoredPairs}

So is this not correct then? And could you comment on the glob issue with the key? thanks

bergmeister commented 4 years ago

@plastikfan The glob pattern is to specify the module names to allow publishing for. In your case I think it should be set to Krayola and not Plaskikfan.*.. I think the module name and the name of the module to be published have to be the same. If you want the module name to be Plaskikfan.Krayola, then I think you probably have to change the name of your module as well. Since there is no other Krayola module published already, I don't think the name should be an issue. A lazy option for the glob pattern would also be just * but for enhanced security I suggest you specify the exact module name. If you want to experiment a bit before publishing there is also the https://www.poshtestgallery.com/ where you could test publish your module before:

try {
    Register-PackageSource -Name PoshTestGallery -Location https://www.poshtestgallery.com/api/v2/ -ProviderName PowerShellGet
    Publish-Module -Name Krayola -NuGetApiKey $NuGetApiKey
}
finally {
    Unregister-PSRepository -Name PoshTestGallery
}
plastikfan commented 4 years ago

Ok thanks, I will first try the test gallery. The Publish-Module documentation on the msdn does not say that the Path has to be specified. In fact it says that the module is published from it's registered location, which is why I didn't specify the Path.

And as for the glob pattern and keys. I do not want to have the burden of managing lots of keys, one for each module, so I should probably use a prefix and then make my module name Plastikfan.Krayola. I have a suite of other modules that I'll be building and having a key for each one would be extremely error prone and tedious.

bergmeister commented 4 years ago

Ok, then in that case you would just specify * in the glob. Using a Plastikfan. prefix is optional though but I think module and publish name have to match.

plastikfan commented 4 years ago

I registered a new repository locally:

$parameters = @{
  Name               = "TestGallery"
  SourceLocation     = "https://www.poshtestgallery.com/api/v2"
  PublishLocation    = "https://www.poshtestgallery.com/api/v2/Packages"
  InstallationPolicy = 'Trusted'
}

Register-PSRepository @parameters

then check:

PS C:\Users\Plastikfan\dev\github\ps\Krayola> Get-PSRepository

Name                      InstallationPolicy   SourceLocation
----                      ------------------   --------------
TestGallery               Trusted              https://www.poshtestgallery.com/api/v2
PSGallery                 Untrusted            https://www.powershellgallery.com/api/v2

Then I'm using * as the glob for a new key generated on poshtestgallery.com.

Then I publish with:

PS C:\Users\Plastikfan\dev\github\ps\Krayola> Publish-Module -Name Krayola -Repository TestGallery -NuGetApiKey <KEY>
Write-Error: C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:10946
 Line |
10946 |  …             Publish-PSArtifactUtility @PublishPSArtifactUtility_Param …
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      | Failed to publish module 'Krayola': 'nuget.exe failed to push Response status code does not indicate success: 404 (Not Found). '.

PS C:\Users\Plastikfan\dev\github\ps\Krayola>

I then tried to use Path instead of name:

PS C:\Users\Plastikfan\dev\github\ps\Krayola> Publish-Module  -Repository TestGallery -NuGetApiKey <KEY> -Path C:\Users\Plastikfan\Documents\PowerShell\Modules\Krayola
Write-Error: C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:10946
 Line |
10946 |  …             Publish-PSArtifactUtility @PublishPSArtifactUtility_Param …
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      | Failed to publish module 'Krayola': 'nuget.exe failed to push Response status code does not indicate success: 404 (Not Found). '.

PS C:\Users\Plastikfan\dev\github\ps\Krayola>

So its failing on PoshTestGallery with a 404 instead of a 403.

I suppose, the 404 might be because now I'm using as the glob, as the 404 being returned is a reflection of this change, so another problem. (I just changed the glob to Plastikfan. to match what I was doing on powershellgallery, but this makes no difference, I'm still getting a 404). So PoshTestGallery and PowerShellGallery are behaving in a similar way, except for the HTTP result code being returned.

bergmeister commented 4 years ago

Can you help @edyoung ?

plastikfan commented 4 years ago

Ok, I have more interesting info. I turned on the verbose flag and got some very strange messages:

PS C:\Users\Plastikfan\dev\github\ps\Krayola> Publish-Module -Name Krayola -Repository TestGallery -NuGetApiKey oy2bpy74jdtvblxigomq5raxkoa52rnufbaq24frxl7swa -Verbose
VERBOSE: Repository details, Name = 'TestGallery', Location = 'https://www.poshtestgallery.com/api/v2'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Repository details, Name = 'TestGallery', Location = 'https://www.poshtestgallery.com/api/v2'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Publish Location:'https://www.poshtestgallery.com/api/v2/Packages'.
VERBOSE: Module 'Krayola' was found in 'C:\Users\Plastikfan\Documents\PowerShell\Modules\Krayola'.
VERBOSE: Loading module from path 'C:\Users\Plastikfan\AppData\Local\Temp\375351725\Krayola\Krayola.psm1'.
VERBOSE: Repository details, Name = 'TestGallery', Location = 'https://www.poshtestgallery.com/api/v2'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : 'TestGallery'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.poshtestgallery.com/api/v2/items/psscript/' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.poshtestgallery.com/api/v2/items/psscript/FindPackagesById()?id='Krayola'' for ''.
VERBOSE: Total package yield:'0' for the specified package 'Krayola'.
VERBOSE: Repository details, Name = 'TestGallery', Location = 'https://www.poshtestgallery.com/api/v2'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : 'TestGallery'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.poshtestgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.poshtestgallery.com/api/v2/FindPackagesById()?id='Krayola'' for ''.
VERBOSE: Total package yield:'0' for the specified package 'Krayola'.
VERBOSE: Performing the operation "Publish-Module" on target "Version '0.0.1' of module 'Krayola'".
VERBOSE: Calling Publish-PSArtifactUtility
VERBOSE: Calling New-NuspecFile
VERBOSE: Calling New-NugetPackage
VERBOSE: Calling C:\Users\Plastikfan\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\NuGet.exe pack "C:\Users\Plastikfan\AppData\Local\Temp\375351725\Krayola\Krayola.nuspec" -outputdirectory "C:\Users\Plastikfan\AppData\Local\Temp\375351725\Krayola" -noninteractive
VERBOSE: C:\Users\Plastikfan\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\NuGet.exe output:
VERBOSE:        Attempting to build package from 'Krayola.nuspec'.
VERBOSE:        Successfully created package 'C:\Users\Plastikfan\AppData\Local\Temp\375351725\Krayola\Krayola.0.0.1.nupkg'.
VERBOSE:        WARNING: NU5110: The script file 'Internal\split-key-value-pair-formatter.ps1' is outside the 'tools' folder and hence will not be executed during installation of this package. Move it into the 'tools' folder.
VERBOSE:        WARNING: NU5110: The script file 'Public\show-console-colours.ps1' is outside the 'tools' folder and hence will not be executed during installation of this package. Move it into the 'tools' folder.
VERBOSE:        WARNING: NU5110: The script file 'Public\themes.ps1' is outside the 'tools' folder and hence will not be executed during installation of this package. Move it into the 'tools' folder.
VERBOSE:        WARNING: NU5110: The script file 'Public\write-in-colour.ps1' is outside the 'tools' folder and hence will not be executed during installation of this package. Move it into the 'tools' folder.
VERBOSE:        WARNING: NU5110: The script file 'Public\write-raw-pairs-in-colour.ps1' is outside the 'tools' folder and hence will not be executed during installation of this package. Move it into the 'tools' folder.
VERBOSE:        WARNING: NU5110: The script file 'Public\write-themed-coloured-pairs.ps1' is outside the 'tools' folder and hence will not be executed during installation of this package. Move it into the 'tools' folder.
VERBOSE:        WARNING: NU5111: The script file 'Internal\split-key-value-pair-formatter.ps1' is not recognized by NuGet and hence will not be executed during installation of this package. Rename it to install.ps1, uninstall.ps1 or init.ps1 and place it directly under 'tools'.
VERBOSE:        WARNING: NU5111: The script file 'Public\show-console-colours.ps1' is not recognized by NuGet and hence will not be executed during installation of this package. Rename it to install.ps1, uninstall.ps1 or init.ps1 and place it directly under 'tools'.
VERBOSE:        WARNING: NU5111: The script file 'Public\themes.ps1' is not recognized by NuGet and hence will not be executed during installation of this package. Rename it to install.ps1, uninstall.ps1 or init.ps1 and place it directly under 'tools'.
VERBOSE: finished running C:\Users\Plastikfan\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\NuGet.exe with exit code 0
VERBOSE: Created Nuget Package C:\Users\Plastikfan\AppData\Local\Temp\375351725\Krayola\Krayola.0.0.1.nupkg
VERBOSE: Successfully created nuget package at C:\Users\Plastikfan\AppData\Local\Temp\375351725\Krayola\Krayola.0.0.1.nupkg
VERBOSE: Calling Publish-NugetPackage -NupkgPath C:\Users\Plastikfan\AppData\Local\Temp\375351725\Krayola\Krayola.0.0.1.nupkg -Destination https://www.poshtestgallery.com/api/v2/Packages -NugetExePath C:\Users\Plastikfan\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\NuGet.exe -UseDotnetCli:False
Write-Error: C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:10946
 Line |
10946 |  …             Publish-PSArtifactUtility @PublishPSArtifactUtility_Param …
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      | Failed to publish module 'Krayola': 'nuget.exe failed to push Response status code does not indicate success: 404 (Not Found). '.

There are many warnings from NuGet about files not being in a location. Why is this the case? Lots of the .ps1 are supposed to be in a 'tools' folder, why? And asking for a files to be renamed to install.ps1. This just all seems wrong.

How do I fix this?

edyoung commented 4 years ago

I don't work on the gallery at the moment and unfortunately too busy to investigate. @alerickson may have some thoughts

scrthq commented 4 years ago

I've had weird experiences with Publish-Module and using a version number not starting at at least 0.1.0. Been a bit but I've standardized my own module start point as version 0.1.0 because of it.

Does this happen on Windows PowerShell as well?

bergmeister commented 4 years ago

@plastikfan Can you share how your psd1 file looks like or upload the whole module folder for inspection (if possible). I've reached out to a few people in the community to help you get this issue diagnosed.

alerickson commented 4 years ago

Hi @plastikfan, can you share your output when running Publish-Module <modulepath> -Repository TestGallery -NuGetApiKey <key> -Verbose -Debug ?

Also make sure to create delete the key above since it's exposed here and create a new one (preferably with the '*' glob pattern as mentioned earlier for debugging purposes)

plastikfan commented 4 years ago

Hi@alerickson, I just ran your command (I also regenerated my key and using * glob pattern):

Publish-Module -Path C:\Users\Plastikfan\Documents\PowerShell\Modules\Krayola -Repository TestGallery -NuGetApiKey $TESTKEY -Verbose -Debug

Something slightly different happened part way through the publish attempt; I was prompted to confirm publishing version 0.0.1 of the module, which didn't happen before, but the result was still the same: result 404:

DEBUG: 00:00:00.0000015 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0001358 ErrorVariable: ev
DEBUG: 00:00:00.0002205 Name: TestGallery
DEBUG: 00:00:00.0012567 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0020563 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.0056711 Yielding package source for TestGallery at location https://www.poshtestgallery.com/api/v2
DEBUG: 00:00:00.0067257 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.0112772 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0113609 ErrorVariable: ev
DEBUG: 00:00:00.0114159 Name: TestGallery
DEBUG: 00:00:00.0150053 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1
DEBUG: 00:00:00.0157271 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0171182 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0209286 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0209985 ErrorVariable: ev
DEBUG: 00:00:00.0210538 Name: TestGallery
DEBUG: 00:00:00.0217601 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1
DEBUG: 00:00:00.0223759 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0247771 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0431566 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0443159 ProviderName: PowerShellGet
DEBUG: 00:00:00.0453069 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.0463415 Name: TestGallery
DEBUG: 00:00:00.0473873 ErrorVariable: ev
DEBUG: 00:00:00.0485180 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0492756 In PowerShellGet Provider - 'Resolve-PackageSource'.
VERBOSE: Repository details, Name = 'TestGallery', Location = 'https://www.poshtestgallery.com/api/v2'; IsTrusted = 'True'; IsRegistered = 'True'.
DEBUG: 00:00:00.0515836 Yielding package source for TestGallery at location https://www.poshtestgallery.com/api/v2
DEBUG: 00:00:00.0522876 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.0557382 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0562404 ProviderName: PowerShellGet
DEBUG: 00:00:00.0567150 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.0571943 Name: TestGallery
DEBUG: 00:00:00.0576659 ErrorVariable: ev
DEBUG: 00:00:00.0583159 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0591588 In PowerShellGet Provider - 'Resolve-PackageSource'.
VERBOSE: Repository details, Name = 'TestGallery', Location = 'https://www.poshtestgallery.com/api/v2'; IsTrusted = 'True'; IsRegistered = 'True'.
DEBUG: 00:00:00.0608144 Yielding package source for TestGallery at location https://www.poshtestgallery.com/api/v2
DEBUG: 00:00:00.0615436 Done calling powershell «Resolve-PackageSource» «PSModule»
VERBOSE: Publish Location:'https://www.poshtestgallery.com/api/v2/Packages'.
VERBOSE: Loading module from path 'C:\Users\Plastikfan\Documents\PowerShell\Modules\Krayola\Krayola.psm1'.
VERBOSE: Module 'Krayola' was found in 'C:\Users\Plastikfan\Documents\PowerShell\Modules\Krayola'.
VERBOSE: Loading module from path 'C:\Users\Plastikfan\AppData\Local\Temp\753411067\Krayola\Krayola.psm1'.
DEBUG: 00:00:00 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0000251 Verbose: False
DEBUG: 00:00:00.0000391 Name: TestGallery
DEBUG: 00:00:00.0000517 ErrorVariable: ev
DEBUG: 00:00:00.0005033 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0010115 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.0022538 Yielding package source for TestGallery at location https://www.poshtestgallery.com/api/v2
DEBUG: 00:00:00.0027558 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.0055288 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0055589 Verbose: False
DEBUG: 00:00:00.0055726 Name: TestGallery
DEBUG: 00:00:00.0055843 ErrorVariable: ev
DEBUG: 00:00:00.0059909 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1
DEBUG: 00:00:00.0064486 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0073302 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0103651 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0103864 Verbose: False
DEBUG: 00:00:00.0104080 Name: TestGallery
DEBUG: 00:00:00.0104220 ErrorVariable: ev
DEBUG: 00:00:00.0108160 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1
DEBUG: 00:00:00.0112422 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0126060 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0261067 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0270059 Verbose: False
DEBUG: 00:00:00.0279799 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.0289529 Name: TestGallery
DEBUG: 00:00:00.0299057 ProviderName: PowerShellGet
DEBUG: 00:00:00.0308646 ErrorVariable: ev
DEBUG: 00:00:00.0348666 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0357650 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.0374056 Yielding package source for TestGallery at location https://www.poshtestgallery.com/api/v2
DEBUG: 00:00:00.0381843 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.0414657 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0423092 Verbose: False
DEBUG: 00:00:00.0431374 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.0439997 Name: TestGallery
DEBUG: 00:00:00.0449067 ProviderName: PowerShellGet
DEBUG: 00:00:00.0458575 ErrorVariable: ev
DEBUG: 00:00:00.0468478 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0496511 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.0513940 Yielding package source for TestGallery at location https://www.poshtestgallery.com/api/v2
DEBUG: 00:00:00.0528082 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0000274 ErrorAction: SilentlyContinue
DEBUG: 00:00:00.0000410 Debug: True
DEBUG: 00:00:00.0000539 Source: TestGallery
DEBUG: 00:00:00.0000653 Verbose: True
DEBUG: 00:00:00.0000779 WarningAction: SilentlyContinue
DEBUG: 00:00:00.0000902 Name: Krayola
DEBUG: 00:00:00.0009586 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0013916 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.0025924 Yielding package source for TestGallery at location https://www.poshtestgallery.com/api/v2
DEBUG: 00:00:00.0031380 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.0060010 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0060249 ErrorAction: SilentlyContinue
DEBUG: 00:00:00.0060379 Debug: True
DEBUG: 00:00:00.0060508 Source: TestGallery
DEBUG: 00:00:00.0060623 Verbose: True
DEBUG: 00:00:00.0060750 WarningAction: SilentlyContinue
DEBUG: 00:00:00.0060872 Name: Krayola
DEBUG: 00:00:00.0066160 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1
DEBUG: 00:00:00.0071156 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0080322 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0108966 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0109156 ErrorAction: SilentlyContinue
DEBUG: 00:00:00.0109293 Debug: True
DEBUG: 00:00:00.0109420 Source: TestGallery
DEBUG: 00:00:00.0109531 Verbose: True
DEBUG: 00:00:00.0109653 WarningAction: SilentlyContinue
DEBUG: 00:00:00.0109772 Name: Krayola
DEBUG: 00:00:00.0113976 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1
DEBUG: 00:00:00.0118510 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0131299 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0158124 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0158318 ErrorAction: SilentlyContinue
DEBUG: 00:00:00.0158540 Debug: True
DEBUG: 00:00:00.0158674 Source: TestGallery
DEBUG: 00:00:00.0158790 Verbose: True
DEBUG: 00:00:00.0158910 WarningAction: SilentlyContinue
DEBUG: 00:00:00.0159026 Name: Krayola
DEBUG: 00:00:00.0163256 INVOKING PowerShell Fn Get-DynamicOptions with args Package that has length 1
DEBUG: 00:00:00.0167815 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0189450 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0926866 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0957451 ErrorAction: SilentlyContinue
DEBUG: 00:00:00.1024985 Verbose: True
DEBUG: 00:00:00.1043453 Debug: True
DEBUG: 00:00:00.1059067 Tag: PSScript
DEBUG: 00:00:00.1075408 AllowPrereleaseVersions: True
DEBUG: 00:00:00.1093186 Type: Script
DEBUG: 00:00:00.1111368 Source: TestGallery
DEBUG: 00:00:00.1129532 ProviderName: PowerShellGet
DEBUG: 00:00:00.1147296 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1165314 WarningAction: SilentlyContinue
DEBUG: 00:00:00.1183520 Name: Krayola
DEBUG: 00:00:00.1199229 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.1214507 In PowerShellGet Provider - 'Resolve-PackageSource'.
VERBOSE: Repository details, Name = 'TestGallery', Location = 'https://www.poshtestgallery.com/api/v2'; IsTrusted = 'True'; IsRegistered = 'True'.
DEBUG: 00:00:00.1267793 Yielding package source for TestGallery at location https://www.poshtestgallery.com/api/v2
DEBUG: 00:00:00.1283767 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.1285454 Calling SearchForPackages. Name='Krayola'
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
DEBUG: 00:00:00.1296168 PackageProvider::FindPackage with name Krayola
DEBUG: 00:00:00.1301887 Calling SearchForPackages After Select 1
DEBUG: 00:00:00.1347713 Calling New() : MethodName = 'FindPackage'
DEBUG: 00:00:00.1365986 ErrorAction: SilentlyContinue
DEBUG: 00:00:00.1384246 Verbose: True
DEBUG: 00:00:00.1414254 Debug: True
DEBUG: 00:00:00.1433195 Tag: PSScript
DEBUG: 00:00:00.1451551 AllowPrereleaseVersions: True
DEBUG: 00:00:00.1469829 Type: Script
DEBUG: 00:00:00.1486692 Source: TestGallery
DEBUG: 00:00:00.1504275 ProviderName: PowerShellGet
DEBUG: 00:00:00.1522534 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1540814 WarningAction: SilentlyContinue
DEBUG: 00:00:00.1575451 Name: Krayola
DEBUG: 00:00:00.1591704 INVOKING PowerShell Fn Find-Package with args System.String[], , ,  that has length 4
DEBUG: 00:00:00.1606755 In PowerShellGet Provider - 'Find-Package'.
DEBUG: 00:00:00.1623268 OPTION: ErrorAction => SilentlyContinue
DEBUG: 00:00:00.1640404 OPTION: Verbose => True
DEBUG: 00:00:00.1657453 OPTION: Debug => True
DEBUG: 00:00:00.1674752 OPTION: Tag => PSScript
DEBUG: 00:00:00.1692448 OPTION: AllowPrereleaseVersions => True
DEBUG: 00:00:00.1727768 OPTION: Type => Script
DEBUG: 00:00:00.1745598 OPTION: Source => TestGallery
DEBUG: 00:00:00.1763300 OPTION: ProviderName => PowerShellGet
DEBUG: 00:00:00.1780738 OPTION: MessageResolver => Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1798106 OPTION: WarningAction => SilentlyContinue
DEBUG: 00:00:00.1814758 OPTION: Name => Krayola
VERBOSE: Using the specified source names : 'TestGallery'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.poshtestgallery.com/api/v2/items/psscript/' and PackageManagementProvider is 'NuGet'.
DEBUG: 00:00:00.1891010 PackageProvider::FindPackage with name Krayola
DEBUG: 00:00:00.1920481 Calling 'NuGet'::'FindPackage' - name='Krayola', requiredVersion='',minimumVersion='', maximumVersion='''.
DEBUG: 00:00:00.1940229 Iterating 'Krayola'.
DEBUG: 00:00:00.1954617 There are '1' registered sources in 'NuGet' provider.
DEBUG: 00:00:00.1973040 Source 'https://www.poshtestgallery.com/api/v2/items/psscript/' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:00.1992199 Source 'https://www.poshtestgallery.com/api/v2/items/psscript/' is validated.
DEBUG: 00:00:00.2009986 Calling 'NuGetRequest'::'GetPackageById', 'Krayola'.
DEBUG: 00:00:00.2049118 Calling 'NuGetPackageRepository'::'FindPackagesById', 'Krayola'.
DEBUG: 00:00:00.2066300 Calling 'NuGetPackageFeed2'::'FindPackage', 'Krayola'.
DEBUG: 00:00:00.2085925 Calling 'NuGetClient'::'FindPackage'.
VERBOSE: Searching repository 'https://www.poshtestgallery.com/api/v2/items/psscript/FindPackagesById()?id='Krayola'' for ''.
DEBUG: 00:00:00.2124997 Downloading 'https://www.poshtestgallery.com/api/v2/items/psscript/FindPackagesById()?id='Krayola'&$skip=0&$top=40'.
DEBUG: 00:00:00.5824487 Completed downloading 'https://www.poshtestgallery.com/api/v2/items/psscript/FindPackagesById()?id='Krayola'&$skip=0&$top=40'.
DEBUG: 00:00:00.5905448 '0' packages received in the last request.
DEBUG: 00:00:00.5953027 System.ArgumentNullException: Value cannot be null. (Parameter 'source')
   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Linq.GroupedEnumerable`2..ctor(IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)
   at System.Linq.Enumerable.GroupBy[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)
   at Microsoft.PackageManagement.NuGetProvider.NuGetRequest.GetPackageById(PackageSource source, String name, NuGetRequest request, String requiredVersion, String minimumVersion, String maximumVersion, Boolean minInclusive, Boolean maxInclusive, Boolean isDependency)
VERBOSE: Total package yield:'0' for the specified package 'Krayola'.
DEBUG: 00:00:00.6046260 Completed iterating for 'Krayola'.
DEBUG: 00:00:00.6096353 Calling 'NuGetRequest'::'FindRegisteredSource', 'https://www.poshtestgallery.com/api/v2/items/psscript/'.
DEBUG: 00:00:00.6185117 PowerShell Script 'PSModule' Function 'Find-Package' returns null.
DEBUG: 00:00:00.6226855 Done calling powershell «Find-Package» «PSModule»
DEBUG: 00:00:00.6307345 unmatched package name='Krayola'
DEBUG: 00:00:00.0000003 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0001013 Verbose: False
DEBUG: 00:00:00.0001655 Name: TestGallery
DEBUG: 00:00:00.0002244 ErrorVariable: ev
DEBUG: 00:00:00.0019069 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0035963 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.0088506 Yielding package source for TestGallery at location https://www.poshtestgallery.com/api/v2
DEBUG: 00:00:00.0108556 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.0225494 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0226446 Verbose: False
DEBUG: 00:00:00.0227095 Name: TestGallery
DEBUG: 00:00:00.0227659 ErrorVariable: ev
DEBUG: 00:00:00.0244901 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1
DEBUG: 00:00:00.0261226 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0291407 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0410930 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0411846 Verbose: False
DEBUG: 00:00:00.0412519 Name: TestGallery
DEBUG: 00:00:00.0413125 ErrorVariable: ev
DEBUG: 00:00:00.0429287 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1
DEBUG: 00:00:00.0445405 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0495877 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.1667890 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.1710132 Verbose: False
DEBUG: 00:00:00.1841830 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1892903 Name: TestGallery
DEBUG: 00:00:00.1959378 ProviderName: PowerShellGet
DEBUG: 00:00:00.2001403 ErrorVariable: ev
DEBUG: 00:00:00.2060617 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.2078390 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.2118362 Yielding package source for TestGallery at location https://www.poshtestgallery.com/api/v2
DEBUG: 00:00:00.2143145 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.2207589 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.2227223 Verbose: False
DEBUG: 00:00:00.2241015 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.2256291 Name: TestGallery
DEBUG: 00:00:00.2270719 ProviderName: PowerShellGet
DEBUG: 00:00:00.2285036 ErrorVariable: ev
DEBUG: 00:00:00.2301240 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.2317178 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.2350848 Yielding package source for TestGallery at location https://www.poshtestgallery.com/api/v2
DEBUG: 00:00:00.2373553 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.0000001 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0000267 ErrorAction: SilentlyContinue
DEBUG: 00:00:00.0000407 Debug: True
DEBUG: 00:00:00.0000537 Source: TestGallery
DEBUG: 00:00:00.0000654 Verbose: True
DEBUG: 00:00:00.0000773 WarningAction: SilentlyContinue
DEBUG: 00:00:00.0000892 Name: Krayola
DEBUG: 00:00:00.0005118 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0008450 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.0019193 Yielding package source for TestGallery at location https://www.poshtestgallery.com/api/v2
DEBUG: 00:00:00.0023808 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.0049862 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0050068 ErrorAction: SilentlyContinue
DEBUG: 00:00:00.0050201 Debug: True
DEBUG: 00:00:00.0050322 Source: TestGallery
DEBUG: 00:00:00.0050434 Verbose: True
DEBUG: 00:00:00.0050552 WarningAction: SilentlyContinue
DEBUG: 00:00:00.0050669 Name: Krayola
DEBUG: 00:00:00.0054783 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1
DEBUG: 00:00:00.0058190 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0072564 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0098288 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0098497 ErrorAction: SilentlyContinue
DEBUG: 00:00:00.0098637 Debug: True
DEBUG: 00:00:00.0098765 Source: TestGallery
DEBUG: 00:00:00.0098879 Verbose: True
DEBUG: 00:00:00.0099004 WarningAction: SilentlyContinue
DEBUG: 00:00:00.0099127 Name: Krayola
DEBUG: 00:00:00.0103330 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1
DEBUG: 00:00:00.0106785 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0117805 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0141966 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0142169 ErrorAction: SilentlyContinue
DEBUG: 00:00:00.0142380 Debug: True
DEBUG: 00:00:00.0142517 Source: TestGallery
DEBUG: 00:00:00.0142635 Verbose: True
DEBUG: 00:00:00.0142756 WarningAction: SilentlyContinue
DEBUG: 00:00:00.0142875 Name: Krayola
DEBUG: 00:00:00.0146921 INVOKING PowerShell Fn Get-DynamicOptions with args Package that has length 1
DEBUG: 00:00:00.0150373 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0171304 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0515626 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0525280 ErrorAction: SilentlyContinue
DEBUG: 00:00:00.0535187 Debug: True
DEBUG: 00:00:00.0544187 Source: TestGallery
DEBUG: 00:00:00.0551510 AllowPrereleaseVersions: True
DEBUG: 00:00:00.0558847 Type: Module
DEBUG: 00:00:00.0566396 Verbose: True
DEBUG: 00:00:00.0574211 ProviderName: PowerShellGet
DEBUG: 00:00:00.0584416 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.0592213 WarningAction: SilentlyContinue
DEBUG: 00:00:00.0622397 Name: Krayola
DEBUG: 00:00:00.0720233 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0728876 In PowerShellGet Provider - 'Resolve-PackageSource'.
VERBOSE: Repository details, Name = 'TestGallery', Location = 'https://www.poshtestgallery.com/api/v2'; IsTrusted = 'True'; IsRegistered = 'True'.
DEBUG: 00:00:00.0751769 Yielding package source for TestGallery at location https://www.poshtestgallery.com/api/v2
DEBUG: 00:00:00.0772860 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.0774517 Calling SearchForPackages. Name='Krayola'
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
DEBUG: 00:00:00.0782431 PackageProvider::FindPackage with name Krayola
DEBUG: 00:00:00.0785769 Calling SearchForPackages After Select 1
DEBUG: 00:00:00.0805244 Calling New() : MethodName = 'FindPackage'
DEBUG: 00:00:00.0812698 ErrorAction: SilentlyContinue
DEBUG: 00:00:00.0820127 Debug: True
DEBUG: 00:00:00.0827553 Source: TestGallery
DEBUG: 00:00:00.0835117 AllowPrereleaseVersions: True
DEBUG: 00:00:00.0842514 Type: Module
DEBUG: 00:00:00.0849912 Verbose: True
DEBUG: 00:00:00.0857287 ProviderName: PowerShellGet
DEBUG: 00:00:00.0864686 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.0872589 WarningAction: SilentlyContinue
DEBUG: 00:00:00.0880392 Name: Krayola
DEBUG: 00:00:00.0890110 INVOKING PowerShell Fn Find-Package with args System.String[], , ,  that has length 4
DEBUG: 00:00:00.0899588 In PowerShellGet Provider - 'Find-Package'.
DEBUG: 00:00:00.0930643 OPTION: ErrorAction => SilentlyContinue
DEBUG: 00:00:00.0938551 OPTION: Debug => True
DEBUG: 00:00:00.0946830 OPTION: Source => TestGallery
DEBUG: 00:00:00.0957095 OPTION: AllowPrereleaseVersions => True
DEBUG: 00:00:00.0966178 OPTION: Type => Module
DEBUG: 00:00:00.0975630 OPTION: Verbose => True
DEBUG: 00:00:00.0985042 OPTION: ProviderName => PowerShellGet
DEBUG: 00:00:00.0994445 OPTION: MessageResolver => Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1003889 OPTION: WarningAction => SilentlyContinue
DEBUG: 00:00:00.1013315 OPTION: Name => Krayola
VERBOSE: Using the specified source names : 'TestGallery'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.poshtestgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
DEBUG: 00:00:00.1074698 PackageProvider::FindPackage with name Krayola
DEBUG: 00:00:00.1153641 Calling 'NuGet'::'FindPackage' - name='Krayola', requiredVersion='',minimumVersion='', maximumVersion='''.
DEBUG: 00:00:00.1168527 Iterating 'Krayola'.
DEBUG: 00:00:00.1180041 There are '1' registered sources in 'NuGet' provider.
DEBUG: 00:00:00.1194587 Source 'https://www.poshtestgallery.com/api/v2' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:00.1209261 Source 'https://www.poshtestgallery.com/api/v2' is validated.
DEBUG: 00:00:00.1222999 Calling 'NuGetRequest'::'GetPackageById', 'Krayola'.
DEBUG: 00:00:00.1237041 Calling 'NuGetPackageRepository'::'FindPackagesById', 'Krayola'.
DEBUG: 00:00:00.1252328 Calling 'NuGetPackageFeed2'::'FindPackage', 'Krayola'.
DEBUG: 00:00:00.1267142 Calling 'NuGetClient'::'FindPackage'.
VERBOSE: Searching repository 'https://www.poshtestgallery.com/api/v2/FindPackagesById()?id='Krayola'' for ''.
DEBUG: 00:00:00.1313808 Downloading 'https://www.poshtestgallery.com/api/v2/FindPackagesById()?id='Krayola'&$skip=0&$top=40'.
DEBUG: 00:00:00.4255955 Completed downloading 'https://www.poshtestgallery.com/api/v2/FindPackagesById()?id='Krayola'&$skip=0&$top=40'.
DEBUG: 00:00:00.4333432 '0' packages received in the last request.
DEBUG: 00:00:00.4404551 System.ArgumentNullException: Value cannot be null. (Parameter 'source')
   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Linq.GroupedEnumerable`2..ctor(IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)
   at System.Linq.Enumerable.GroupBy[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)
   at Microsoft.PackageManagement.NuGetProvider.NuGetRequest.GetPackageById(PackageSource source, String name, NuGetRequest request, String requiredVersion, String minimumVersion, String maximumVersion, Boolean minInclusive, Boolean maxInclusive, Boolean isDependency)
VERBOSE: Total package yield:'0' for the specified package 'Krayola'.
DEBUG: 00:00:00.4502320 Completed iterating for 'Krayola'.
DEBUG: 00:00:00.4602428 Calling 'NuGetRequest'::'FindRegisteredSource', 'https://www.poshtestgallery.com/api/v2'.
DEBUG: 00:00:00.4644905 PowerShell Script 'PSModule' Function 'Find-Package' returns null.
DEBUG: 00:00:00.4728620 Done calling powershell «Find-Package» «PSModule»
DEBUG: 00:00:00.4774484 unmatched package name='Krayola'

Confirm
Are you sure you want to perform this action?
Performing the operation "Publish-Module" on target "Version '0.0.1' of module 'Krayola'".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y
VERBOSE: Calling Publish-PSArtifactUtility
VERBOSE: Calling New-NuspecFile
VERBOSE: Calling New-NugetPackage
VERBOSE: Calling C:\Users\Plastikfan\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\NuGet.exe pack "C:\Users\Plastikfan\AppData\Local\Temp\753411067\Krayola\Krayola.nuspec" -outputdirectory "C:\Users\Plastikfan\AppData\Local\Temp\753411067\Krayola" -noninteractive
VERBOSE: C:\Users\Plastikfan\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\NuGet.exe output:
VERBOSE:        Attempting to build package from 'Krayola.nuspec'.
VERBOSE:        Successfully created package 'C:\Users\Plastikfan\AppData\Local\Temp\753411067\Krayola\Krayola.0.0.1.nupkg'.
VERBOSE:        WARNING: NU5110: The script file 'Internal\split-key-value-pair-formatter.ps1' is outside the 'tools' folder and hence will not be executed during installation of this package. Move it into the 'tools' folder.
VERBOSE:        WARNING: NU5110: The script file 'Public\show-console-colours.ps1' is outside the 'tools' folder and hence will not be executed during installation of this package. Move it into the 'tools' folder.
VERBOSE:        WARNING: NU5110: The script file 'Public\themes.ps1' is outside the 'tools' folder and hence will not be executed during installation of this package. Move it into the 'tools' folder.
VERBOSE:        WARNING: NU5110: The script file 'Public\write-in-colour.ps1' is outside the 'tools' folder and hence will not be executed during installation of this package. Move it into the 'tools' folder.
VERBOSE:        WARNING: NU5110: The script file 'Public\write-raw-pairs-in-colour.ps1' is outside the 'tools' folder and hence will not be executed during installation of this package. Move it into the 'tools' folder.
VERBOSE:        WARNING: NU5110: The script file 'Public\write-themed-coloured-pairs.ps1' is outside the 'tools' folder and hence will not be executed during installation of this package. Move it into the 'tools' folder.
VERBOSE:        WARNING: NU5111: The script file 'Internal\split-key-value-pair-formatter.ps1' is not recognized by NuGet and hence will not be executed during installation of this package. Rename it to install.ps1, uninstall.ps1 or init.ps1 and place it directly under 'tools'.
VERBOSE:        WARNING: NU5111: The script file 'Public\show-console-colours.ps1' is not recognized by NuGet and hence will not be executed during installation of this package. Rename it to install.ps1, uninstall.ps1 or init.ps1 and place it directly under 'tools'.
VERBOSE: finished running C:\Users\Plastikfan\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\NuGet.exe with exit code 0
VERBOSE: Created Nuget Package C:\Users\Plastikfan\AppData\Local\Temp\753411067\Krayola\Krayola.0.0.1.nupkg
VERBOSE: Successfully created nuget package at C:\Users\Plastikfan\AppData\Local\Temp\753411067\Krayola\Krayola.0.0.1.nupkg
VERBOSE: Calling Publish-NugetPackage -NupkgPath C:\Users\Plastikfan\AppData\Local\Temp\753411067\Krayola\Krayola.0.0.1.nupkg -Destination https://www.poshtestgallery.com/api/v2/Packages -NugetExePath C:\Users\Plastikfan\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\NuGet.exe -UseDotnetCli:False
Write-Error: C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:10946
 Line |
10946 |  …             Publish-PSArtifactUtility @PublishPSArtifactUtility_Param …
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      | Failed to publish module 'Krayola': 'nuget.exe failed to push Response status code does not indicate success: 404 (Not Found). '.

PS C:\Users\Plastikfan\dev\github\ps\Krayola>                                                                                                     
plastikfan commented 4 years ago

I've had weird experiences with Publish-Module and using a version number not starting at at least 0.1.0. Been a bit but I've standardized my own module start point as version 0.1.0 because of it.

Does this happen on Windows PowerShell as well?

I've been doing all my publishing from windows 10. I really wanted to publish from macOS, but doing so fails, because simply having powershell core installed is not enough to allow publishing for some reason and installing other dependencies looks like a long and painful drawn out process, so I gave up and decided to perform all my publishing actives from windows.

And about the version number, I haven't yet tried 0.1.0, perhaps I'll try that next (after seeing the response from other PowerShell/Microsoft guys.

plastikfan commented 4 years ago

@plastikfan Can you share how your psd1 file looks like or upload the whole module folder for inspection (if possible). I've reached out to a few people in the community to help you get this issue diagnosed.

You can see my whole repo at Krayola(develop)

plastikfan commented 4 years ago

I decided to install the pre-requisites on my mac, (.NET SDK), and then tried to publish from mac (10.16.6 Mojave) and I get a similar error, except I can see more of what "Publish-PSArtifactUtility @PublishPSArtifactUtility_Param" is:

10946 |  …             Publish-PSArtifactUtility @PublishPSArtifactUtility_Param …
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      | Failed to publish module 'Krayola': 'dotnet cli failed to nuget push Pushing Krayola.0.0.1.nupkg to 'https://www.poshtestgallery.com/api/v2/Packages'...   PUT https://www.poshtestgallery.com/api/v2/Packages/   NotFound
      | https://www.poshtestgallery.com/api/v2/Packages/ 617ms error: Response status code does not indicate success: 404 (Not Found).   Usage: dotnet nuget push [arguments] [options]  Arguments:   [root]  Specify the path to the package and your API key
      | to push the package to the server.  Options:   -h|--help                      Show help information   --force-english-output         Forces the application to run using an invariant, English-based culture.   -s|--source <source>          
      | Specifies the server URL   -ss|--symbol-source <source>   Specifies the symbol server URL. If not specified, nuget.smbsrc.net is used when pushing to nuget.org.   -t|--timeout <timeout>         Specifies the timeout for pushing to a server in
      | seconds. Defaults to 300 seconds (5 minutes).   -k|--api-key <apiKey>          The API key for the server.   -sk|--symbol-api-key <apiKey>  The API key for the symbol server.   -d|--disable-buffering         Disable buffering when pushing to an
      | HTTP(S) server to decrease memory usage.   -n|--no-symbols                If a symbols package exists, it will not be pushed to a symbols server.   --no-service-endpoint          Does not append "api/v2/package" to the source URL.   --interactive 
      | Allow the command to block and require manual action for operations like authentication.   --skip-duplicate               If a package and version already exists, skip it and continue with the next package in the push, if any. '.
plastikfan commented 4 years ago

And I tried again the publish to PowerShellGallery:

PS /Users/Plastikfan/dev/ps> Publish-Module -Name Krayola -Repository PSGallery -NuGetApiKey <KEY>
Write-Error: /usr/local/microsoft/powershell/7/Modules/PowerShellGet/PSModule.psm1:10946
 Line |
10946 |  …             Publish-PSArtifactUtility @PublishPSArtifactUtility_Param …
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      | Failed to publish module 'Krayola': 'dotnet cli failed to nuget push Pushing Krayola.0.0.1.nupkg to
      | 'https://www.powershellgallery.com/api/v2/package/'...   PUT https://www.powershellgallery.com/api/v2/package/   Forbidden
      | https://www.powershellgallery.com/api/v2/package/ 965ms error: Response status code does not indicate success: 403 (The specified API key is
      | invalid, has expired, or does not have permission to access the specified package.).   Usage: dotnet nuget push [arguments] [options]  Arguments:  
      | [root]  Specify the path to the package and your API key to push the package to the server.  Options:   -h|--help                      Show help
      | information   --force-english-output         Forces the application to run using an invariant, English-based culture.   -s|--source <source>       
      | Specifies the server URL   -ss|--symbol-source <source>   Specifies the symbol server URL. If not specified, nuget.smbsrc.net is used when pushing
      | to nuget.org.   -t|--timeout <timeout>         Specifies the timeout for pushing to a server in seconds. Defaults to 300 seconds (5 minutes).  
      | -k|--api-key <apiKey>          The API key for the server.   -sk|--symbol-api-key <apiKey>  The API key for the symbol server.  
      | -d|--disable-buffering         Disable buffering when pushing to an HTTP(S) server to decrease memory usage.   -n|--no-symbols                If a
      | symbols package exists, it will not be pushed to a symbols server.   --no-service-endpoint          Does not append "api/v2/package" to the source
      | URL.   --interactive                  Allow the command to block and require manual action for operations like authentication.   --skip-duplicate  
      | If a package and version already exists, skip it and continue with the next package in the push, if any. '.

PS /Users/Plastikfan/dev/ps> 
plastikfan commented 4 years ago

I also, tried to publish as version 0.1.0 as @scrthq had suggested, but this does not work either. Doesnt work on either mac or windows, to PowerShellGallery or PoshTestGallery, regardless of version number. I'm really tearing my hair out now, so I need some assistance, pretty please!!

plastikfan commented 4 years ago

I saw this on https://docs.microsoft.com/en-us/powershell/scripting/gallery/faqs?view=powershell-7 The question How can I publish to the PowerShell Gallery offers a couple of reasons why this may occur. I am sure it's not the KEY string that I'm using is not correct, you can't accidentally paste the wrong key in this many times and it it keep failing. The only other option according to this is that the package deoes't belong to me, and suggests that it may have existed in the past and just been deleted. So I tried this, and there's nothing there, so can't have existed before.

I also tried Test-ModuleManifest, which passes:

PS /Users/Plastikfan/dev/ps> "/Users/Plastikfan/.local/share/powershell/Modules/Krayola/Krayola.psd1" | Test-ModuleManifest

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     0.1.0                 Krayola                             {Show-ConsoleColours, Write-ThemedColouredPairs, Write-RawPairsInColour, Write-InColour}

PS /Users/Plastikfan/dev/ps> 

Clearly, without this working, I can't proceed with any of my other work. It also prevents me from continuing to learn more about the rest of the PowerShell ecosystem. Why should I put that effort in if I can't publish a module. Can you at least say that somebody is looking into this, because now I am just really frustrated.

bergmeister commented 4 years ago

@plastikfan I just managed to publish your module to the test gallery: https://www.poshtestgallery.com/packages/Krayola/0.0.1 All I did was (using your develop branch):

git clone https://github.com/plastikfan/Krayola.git
cd .\Krayola\
git checkout develop
cd .\Krayola\
Register-PackageSource -Name PoshTestGallery -Location https://www.poshtestgallery.com/api/v2/ -ProviderName PowerShellGet
Publish-Module -Path . -NuGetApiKey $nuGetApiKey -Repository PoshTestGallery

Therefore I think the issue is with your API key. This is how I created mine: image

plastikfan commented 4 years ago

Now that you published to Test repository, does that mean I now no longer own it?

bergmeister commented 4 years ago

@plastikfan I suggest a screen sharing session together to better help you. Do you have Teams, Skype or something like that? I will unlist the published module on the test gallery now

plastikfan commented 4 years ago

Let me try what you did first ... And yeah, I need to find out the cause of this issue

bergmeister commented 4 years ago

@plastikfan I've now unlisted the module on the posh test gallery in the meantime: image I suggest you try to publish to PSGallery. Are you in a corporate environment with a proxy btw?

plastikfan commented 4 years ago

@plastikfan I just managed to publish your module to the test gallery: https://www.poshtestgallery.com/packages/Krayola/0.0.1 All I did was (using your develop branch):

git clone https://github.com/plastikfan/Krayola.git
cd .\Krayola\
git checkout develop
cd .\Krayola\
Register-PackageSource -Name PoshTestGallery -Location https://www.poshtestgallery.com/api/v2/ -ProviderName PowerShellGet
Publish-Module -Path . -NuGetApiKey $nuGetApiKey -Repository PoshTestGallery

Therefore I think the issue is with your API key. This is how I created mine: image

When you created the Key and type in the glob pattern *, when I do that, it then doesnt show up the package, because it was new and didn't exist. So how did the package name show up (under available packages) on yours when you did it for the forst time?

bergmeister commented 4 years ago

@plastikfan That checkbox doesn't show up the first time when you haven't published the package. The screenshot was when I went into the Create menu again just to show you the options that I had used.

plastikfan commented 4 years ago

Argh, I can see a slight difference in the repo name. When I register the test gallery, I didnt have a provider. However, that wouldnt explain why publishing to PowerShellGallery doesnt work becasue I'm just using the default consfig. I can't see how the original config for PowerShellGallery could be wrong

bergmeister commented 4 years ago

OK. How about you do a new test: I published Bergmeister.Krayola to the test gallery just now and you could make similar modifications to publish your module under the name Plastikfan.Krayola module to the test gallery similar to this one: https://www.poshtestgallery.com/packages/Bergmeister.Krayola/0.0.1

In the psd1: change the GUID to a new GUID value and change the RootModule to Plastikfan.Krayola. Then rename the psd1, psm1 and the folder name to Plastikfan.Krayola:

# In the root directory of the git repo
mv .\Krayola\ Plastikfan.Krayola
 cd .\Plastikfan.Krayola\
mv .\Krayola.psd1 .\Plastikfan.Krayola.psd1
mv .\Krayola.psm1 .\Plastikfan.Krayola.psm1

Then publish again:

Publish-Module -Path . -NuGetApiKey $nuGetApiKey -Repository PoshTestGallery
bergmeister commented 4 years ago

If you want, you can private message me on Twitter if you want to do a quick screen sharing session together as that might be quicker to figure out your issues. https://twitter.com/CBergmeister Are you on a home or corporate network because maybe it is a proxy issue?

plastikfan commented 4 years ago
Screenshot 2020-05-06 at 20 52 02

Here is how my key is defined.

It still fails.

plastikfan commented 4 years ago

Ok, I'll follow you on twitter

bergmeister commented 4 years ago

show me what it says when you click Edit

plastikfan commented 4 years ago
Screenshot 2020-05-06 at 20 55 36
plastikfan commented 4 years ago

I've tried putting the key as a string in quotes and without quotes (but of course that doesnt work)

bergmeister commented 4 years ago

Your screenshot looks ok to me. Can you answer the networking question Are you on a home or corporate network because maybe it is a proxy issue? Do you have the option of using a build/release agent in case it is your local machine configuration or the network?

plastikfan commented 4 years ago

If you want, you can private message me on Twitter if you want to do a quick screen sharing session together as that might be quicker to figure out your issues. https://twitter.com/CBergmeister Are you on a home or corporate network because maybe it is a proxy issue?

I'm on a home network, no proxy

plastikfan commented 4 years ago

With the help of @bergmeister (to whom I give many thanks), I have managed to publish to PoshTestGallery and now PowerShellGallery. I am still not certain of the root of the issue. All I can say is with the use of a shared desktop session, @bergmeister did witness the failure to publish to the test repository and that the way I was doing it was correct. We even tried it on the 7.1.0-preview release of PowerShell and it failed in exactly the same way. There was nothing wrong with the API key I was using despite the error message I kept seeing. The only meaningful thing that changed that led to successful publishing was a de-register and re-register of the PoshTestGallery but with the "NuGet" provider.

But the strange thing is, when I went to publish to PowerShellGallery having successfully published to PoshTestGallery, I was expecting it to fail since I hadn't de-registered and then re-register like I had to do with PoshTestGallery, but it succeeded first time.

I have no idea what happened here, but publish-module can return an error message about the API key when there is no issue with the key.

I am including the full command transcript of the shared desktop session with @bergmeister below (including the key, since deleting it in the transcript may lead to mistaken deletions materially altering the session. The key use in this transcript has been deleted) ....

problems-powershell-publishing.working-on-poshtestgallery.bergmeister-christof.txt

bergmeister commented 4 years ago

@plastikfan Great that you managed to get it to work at the end. Not sure what we did to fix your local system. It seems because when you first registered the posh test gallery, that you did not specify the -ProviderName PowerShellGet parameter on Register-PackageSource, hence why we probably saw a different error at first against the posh test gallery. When you pushed to the PSGallery, did you use PS7 or 7.1-preview? One suspect could be the TLS changes that that the PS teams is planning to make and PS 7.1 already contains the new version of PowerShellGet where Tls1.2 is being used: https://github.com/PowerShell/PowerShellGetv2/pull/598

Out of interest, what does the Elizium pre-fix mean?

plastikfan commented 4 years ago

Hi @bergmeister, I published to PowerShellGallery using PS7 not 7.1-preview. This makes me wonder if there is some other side effect that installing 7.1-preview had on my system that allowed the publish to succeed. I should re-test publishing to PoshTestGallery from my mac partition (which doesn't have the 7.1-preview installed to see if the issue still persists. I imagine I would have to perform the de-register and re-register with the PowerShellGet provider.

And I decided that wanted to publish Krayola with a prefix since creating the ApiKey with a * prefix seems not to be good practice. There is no specific reason for me to choose Elizium, but if you want to know, I am a Fields Of The Nephilim fan, and Elizium is the title of one of their alums, named after Elysium, that being something akin to Nirvana. Sounds good to me!

bergmeister commented 4 years ago

@plastikfan Interesting. When you try to repro on your mac, please take a note of the value of [Net.ServicePointManager]::SecurityProtocol before and after publishing. I am not sure if the TLS 1.2 enforcement is already active on the PSGallery (as far as I know it was deferred but I could be wrong).

plastikfan commented 4 years ago

@bergmeister, ok will do, I'll post the results back here.

plastikfan commented 4 years ago

Well this is strange, I republished from mac, and this time it worked. I didn't have to unregister and re-register the repository as I expected I would have to. The log I attach shows the first attempt failing, but that was because of the version number clash. I upped the version number and re-published and it worked straight away. You will also see that the [Net.ServicePointManager]::SecurityProtocol was set to SystemDefault, before and after doing the publish.

I haven't re-tested publishing to PowerShellGallery. Due to me having recently discovered the new Windows Terminal and seeing how great that is and the Windows subsystem for Linux, I've decided to shift my development environment to Windows as the many gripes I used to have have all gone away, and so the state of publishing from a mac is no longer of interest to me. Windows Terminal and WSL is an awesome setup.

powershell.publish.re-test.ps7.txt

bergmeister commented 4 years ago

Yes, I agree it is strange but at least it seems your local publishing issues are resolved now :-)

twofingerrightclick commented 1 year ago

I am using PowerShellGet 2.2.5 on pwsh 7.2.7 and have the same 403 Forbidden issue of not being able to publish any modules that my company maintains, despite triple checking api keys:

VERBOSE: Successfully created nuget package at C:\Users\user\AppData\Local\Temp\1575231406\IntelliTect.MicrosoftWord\IntelliTect.MicrosoftWord.0.5.0.11.nupkg
VERBOSE: Calling Publish-NugetPackage -NupkgPath C:\Users\user\AppData\Local\Temp\1575231406\IntelliTect.MicrosoftWord\IntelliTect.MicrosoftWord.0.5.0.11.nupkg -Destination https://www.powershellgallery.com/api/v2/package/ -NugetExePath  -UseDotnetCli:True
Write-Error: Failed to publish module 'IntelliTect.MicrosoftWord': 'dotnet cli failed to nuget push Pushing IntelliTect.MicrosoftWord.0.5.0.11.nupkg to 'https://www.powershellgallery.com/api/v2/package/'...   PUT 
https://www.powershellgallery.com/api/v2/package/   Forbidden https://www.powershellgallery.com/api/v2/package/ 3867ms error: Response status code does not indicate success: 403

image

We first notice the error on a Github Linux runner, and so I tried locally on my Windows machine...

The publishing key from the Gallery is a string longer than a guid, but every doc I see says it is to be a guid: https://learn.microsoft.com/en-us/powershell/scripting/gallery/how-to/publishing-packages/publishing-a-package?view=powershell-7.3#publishing-items Not sure if that is something...

I have also just tried publishing a new module (created with New-ModuleManifest), but same result, so it is a tooling/api issue and not something module specific.

anamnavi commented 1 year ago

@twofingerrightclick thanks for reaching out! This may be an issue with the dotnet executable or nuget executable depending on which is being used. We're not actively working on PowerShellGet V2 (including 2.2.5) and instead working on V3....could you try using PowerShellGet 3.0.17-beta17 (link) and seeing if this issue still reproduces for you:

Once you've installed and imported this module version, you can then run Publish-PSResource -Path <yourPath/IntelliTect.MicrosoftWord> -ApiKey <yourApiKey> -Repository PSGallery

twofingerrightclick commented 1 year ago

@anamnavi Thank you for the suggestion. Yeah it looks like the PowerShellGet V2 Publish-Module has step that uses msbuild and targets netcoreapp2.0. (Logs for context):

VERBOSE: Calling C:\Program Files\dotnet\dotnet.exe pack "C:\Users\AustenFrostad\AppData\Local\Temp\fa5dbbf1-8245-4b7f-ac78-10315cf05822\Temp.csproj" /p:NuspecFile="C:\Users\AustenFrostad\AppData\Local\Temp\1127771197\IntelliTect.MicrosoftWord\IntelliTect.MicrosoftWord.nuspec" --output "C:\Users\AustenFrostad\AppData\Local\Temp\1127771197\IntelliTect.MicrosoftWord"
C:\Program Files\dotnet\sdk\7.0.100\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets

using .NET 7

V3's Publish-PSResource appears to not do that build step.... I used PowerShellGet 3.0.17-beta17 and still get the 403 error:

PS D:\Modules\IntelliTect.MicrosoftWord> Publish-PSResource -Path ./ -ApiKey "XXXXXXXXX" -Repository PSGallery -verbose 
VERBOSE: Performing the operation "Publish-PSResource" on target "Publish resource 'D:\repoD\IntelliTect\PSToolbox\Modules\IntelliTect.MicrosoftWord' from the machine".
VERBOSE: Creating new nuspec file.
VERBOSE: The newly created nuspec is: C:\Users\AustenFrostad\AppData\Local\Temp\65aad5b3-be36-4f39-b395-541855357cac\IntelliTect.MicrosoftWord.nuspec
VERBOSE: Successfully packed the resource into a .nupkg
VERBOSE: Not able to publish resource to 'https://www.powershellgallery.com/api/v2'
Publish-PSResource: Repository 'PSGallery': Response status code does not indicate success: 403 (The specified API key is invalid, has expired, or does not have permission to access the specified package.).

The docs for publishing modules for PowerShell 7.3 still use Publish-Module and not Publish-PSResource (obviously as in beta).

I am thinking this is now an API issue with PowerShell Gallery and perhaps not an issue with the publishing tooling?