Are you doing this on a Windows machine that uses a language other than English? If so, have a look at this thread on GitHub: [https://github.com/PowerShell/PowerShellGetv2/issues/606
Error to publish module to private repository
I’m trying to publish a module, which I wrote, to a local repository. The repository is correctly created, if I type
get-psrepository
I see it. When I launch the command
Publish-Module -Path C:\Modules\mymodule -Repository MyRepository
the error that appears is the following
Publish-PSArtifactUtility : Failed to generate the compressed file for module 'Failed to index into an array
null.'.
In C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:10990 car:17
+ ... Publish-PSArtifactUtility @PublishPSArtifactUtility_Param ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : FailedToCreateCompressedModule,Publish-PSArtifactUtility
3 additional answers
Sort by: Most helpful
-
Limitless Technology 44,401 Reputation points
2023-01-26T17:07:11.8666667+00:00 Hi. Thank you for your question and reaching out. I’d be more than happy to help you with your query.
This error message is indicating that the command "Publish-PSArtifactUtility" has failed to generate a compressed file for a PowerShell module. The specific module in question is "Failed to index into an array null." The error occurred in the file "C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1" on line 10990. The error is of type "InvalidOperation" and has the fully qualified error id of "FailedToCreateCompressedModule,Publish-PSArtifactUtility"
It seems that the problem is with the module "Failed to index into an array null." which is causing the error. You should investigate this module and see if there is any issue with it. Also check the module's dependencies and ensure that they are installed and updated.
If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.
-
Limitless Technology 44,401 Reputation points
2023-01-26T17:07:30.1233333+00:00 Double post
-
Francesco Farina 20 Reputation points
2023-01-29T12:55:05.03+00:00 This command solve the problem.
$env:DOTNET_CLI_UI
LANGUAGE="it
IT"