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 no longer work even for module which success before #700

Open
@clor09

Description

@clor09

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

I used to publish my module successfully to gallery server.
after recently i update my module and try to publish the new version. everytime i just got following error:

Write-Error: Failed to generate the compressed file for module 'Cannot index into a null array.'.

i dont think it's a bad manifest or any ps file syntax issue. cause i test my lastest successful version, and only do an version update like Update-ModuleManifest -Path .\XXXXX.psd1 -ModuleVersion 0.0.6. then publish-module for this new test version, it just failed again.

Expected behavior

sussesfully run publish-module like before

Actual behavior

failed with error msg

> Write-Error: Failed to generate the compressed file for module 'Cannot index into a null array.'.

Error details

Type        : System.Management.Automation.ActionPreferenceStopException
ErrorRecord :
    Exception             :
        Type    : Microsoft.PowerShell.Commands.WriteErrorException
        Message : Failed to generate the compressed file for module 'Cannot index into a null array.'.
        HResult : -2146233087
    CategoryInfo          : InvalidOperation: (:) [Write-Error], WriteErrorException
    FullyQualifiedErrorId : FailedToCreateCompressedModule,Publish-PSArtifactUtility
    InvocationInfo        :
        MyCommand        : Publish-PSArtifactUtility
        ScriptLineNumber : 10990
        OffsetInLine     : 17
        HistoryId        : 8
        ScriptName       : C:\program files\windowsapps\microsoft.powershell_7.3.6.0_x64__8wekyb3d8bbwe\Modules\PowerShellGet\PSModule.psm1
        Line             : Publish-PSArtifactUtility @PublishPSArtifactUtility_Params

        PositionMessage  : At C:\program files\windowsapps\microsoft.powershell_7.3.6.0_x64__8wekyb3d8bbwe\Modules\PowerShellGet\PSModule.psm1:10990 char:17
                           + …             Publish-PSArtifactUtility @PublishPSArtifactUtility_Param …
                           +               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        PSScriptRoot     : C:\program files\windowsapps\microsoft.powershell_7.3.6.0_x64__8wekyb3d8bbwe\Modules\PowerShellGet
        PSCommandPath    : C:\program files\windowsapps\microsoft.powershell_7.3.6.0_x64__8wekyb3d8bbwe\Modules\PowerShellGet\PSModule.psm1
        InvocationName   : Publish-PSArtifactUtility
        CommandOrigin    : Internal
    ScriptStackTrace      : at Publish-PSArtifactUtility, C:\program files\windowsapps\microsoft.powershell_7.3.6.0_x64__8wekyb3d8bbwe\Modules\PowerShellGet\PSModule.psm1: line 6011
                            at Publish-Module<Process>, C:\program files\windowsapps\microsoft.powershell_7.3.6.0_x64__8wekyb3d8bbwe\Modules\PowerShellGet\PSModule.psm1: line 10990
                            at <ScriptBlock>, <No file>: line 1
    PipelineIterationInfo :



TargetSite  :
    Name          : Invoke
    DeclaringType : System.Management.Automation.Runspaces.PipelineBase, System.Management.Automation, Version=7.3.6.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35
    MemberType    : Method
    Module        : System.Management.Automation.dll
Message     : The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to generate the compressed file for module 'Cannot index into a null array.'.
Data        : System.Collections.ListDictionaryInternal
Source      : System.Management.Automation
HResult     : -2146233087
StackTrace  :
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at Microsoft.PowerShell.Executor.ExecuteCommandHelper(Pipeline tempPipeline, Exception& exceptionThrown, ExecutionOptions options)

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.6
PSEdition                      Core
GitCommitId                    7.3.6
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

2.2.5

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions