簡體   English   中英

PowerShell Publish-Module已用於指定存儲庫中的其他項目

[英]PowerShell Publish-Module is already used for a different item on the specified repository

我已經使用Publish-Module許多模塊,但是突然我只收到PSGallery的消息

The specified name '$moduleName' is already used for a different item on the specified repository 'PSGallery'. Run 'Find-Script -Name 

$ moduleName -Repository PSGallery'檢查指定名稱'$ moduleName'是否已被使用。

其中$ moduleName是模塊的名稱。 我使用的PowerShell是

Publish-Module -Path $path -NuGetApiKey $key -Repository PSGallery -WhatIf

Find-Module報告$ moduleName確實是一個模塊。 在PowerShell畫廊上,它以模塊形式顯示設計方案Same Publish-Module可用於任何其他PSRepository。

有任何想法嗎?

更新1

我使用Fiddler來比較兩個模塊之間的數據流。

Publish-Module有時會執行此操作(出現問題的模塊的名稱為ISHDeploy.12.0.0)

https://www.powershellgallery.com/api/v2/items/psscript/FindPackagesById()?id='ISHDeploy.12.0.0'&$skip=0&$top=40  

並返回

<id>https://www.powershellgallery.com/api/v2/items/psscript/Packages(Id='ISHDeploy.12.0.0',Version='0.1')</id>
        <category term="NuGetGallery.V2FeedPackage" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
        <link rel="edit" title="V2FeedPackage" href="Packages(Id='ISHDeploy.12.0.0',Version='0.1')" />
        <title type="text">ISHDeploy.12.0.0</title>
        <summary type="text"/>
        <updated>2016-08-01T18:36:38Z</updated>
        <author>
            <name>SDL plc</name>
        </author>
        <link rel="edit-media" title="V2FeedPackage" href="Packages(Id='ISHDeploy.12.0.0',Version='0.1')/$value" />
        <content type="application/zip" src="https://www.powershellgallery.com/api/v2/package/ISHDeploy.12.0.0/0.1.0" />
        <m:properties>
            <d:Version>0.1</d:Version>
            <d:NormalizedVersion>0.1.0</d:NormalizedVersion>
            <d:Copyright>SDL plc. All rights reserved.</d:Copyright>
            <d:Created m:type="Edm.DateTime">2016-06-24T13:11:21.6</d:Created>
            <d:Dependencies/>
            <d:Description>Deployment automation module for SDL Knowledge Center Content Manager 12.0.0 (LiveContent Architect, Trisoft InfoShare)</d:Description>
            <d:DownloadCount m:type="Edm.Int32">33</d:DownloadCount>
            <d:GalleryDetailsUrl>https://www.powershellgallery.com/packages/ISHDeploy.12.0.0/0.1.0</d:GalleryDetailsUrl>
            <d:IconUrl m:null="true" />
            <d:IsLatestVersion m:type="Edm.Boolean">true</d:IsLatestVersion>
            <d:IsAbsoluteLatestVersion m:type="Edm.Boolean">true</d:IsAbsoluteLatestVersion>
            <d:IsPrerelease m:type="Edm.Boolean">false</d:IsPrerelease>
            <d:Language m:null="true" />
            <d:Published m:type="Edm.DateTime">2016-06-24T13:11:21.6</d:Published>
            <d:PackageHash>0BsR7SQjEe7q5XO0IJqMOTS5iySLVYSzUFqHte4Hjng6Fxi+8BaUy3RNqmXs9Q53+QgrddI7e5Lij29kQlLS/g==</d:PackageHash>
            <d:PackageHashAlgorithm>SHA512</d:PackageHashAlgorithm>
            <d:PackageSize m:type="Edm.Int64">2723982</d:PackageSize>
            <d:ProjectUrl>https://sdl.github.io/ISHDeploy/12.0.0/Index.html</d:ProjectUrl>
            <d:ReportAbuseUrl>https://www.powershellgallery.com/package/ReportAbuse/ISHDeploy.12.0.0/0.1.0</d:ReportAbuseUrl>
            <d:ReleaseNotes>https://sdl.github.io/ISHDeploy/12.0.0/CHANGELOG.html</d:ReleaseNotes>
            <d:RequireLicenseAcceptance m:type="Edm.Boolean">false</d:RequireLicenseAcceptance>
            <d:Summary m:null="true" />
            <d:Tags m:null="true" />
            <d:Title m:null="true" />
            <d:VersionDownloadCount m:type="Edm.Int32">33</d:VersionDownloadCount>
            <d:MinClientVersion m:null="true" />
            <d:LastEdited m:type="Edm.DateTime">2016-06-24T14:14:56.217</d:LastEdited>
            <d:LicenseUrl m:null="true" />
            <d:LicenseNames m:null="true" />
            <d:LicenseReportUrl m:null="true" />
            <d:Workflows/>
            <d:ItemType>Module</d:ItemType>
            <d:FileList>ISHDeploy.12.0.0.nuspec|ISHDeploy.12.0.0.dll|ISHDeploy.12.0.0.dll-Help.xml|ISHDeploy.12.0.0.psd1|ISHDeploy.12.0.0.xml|Microsoft.Web.Administration.dll|System.Data.SqlServerCe.dll|amd64\sqlceca40.dll|amd64\sqlcecompact40.dll|amd64\sqlceer40EN.dll|amd64\sqlceme40.dll|amd64\sqlceqp40.dll|amd64\sqlcese40.dll|amd64\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest|amd64\Microsoft.VC90.CRT\msvcr90.dll|amd64\Microsoft.VC90.CRT\README_ENU.txt|x86\sqlceca40.dll|x86\sqlcecompact40.dll|x86\sqlceer40EN.dll|x86\sqlceme40.dll|x86\sqlceqp40.dll|x86\sqlcese40.dll|x86\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest|x86\Microsoft.VC90.CRT\msvcr90.dll|x86\Microsoft.VC90.CRT\README_ENU.txt</d:FileList>
            <d:Cmdlets>Disable-ISHUITranslationJob Enable-ISHUITranslationJob Disable-ISHUIQualityAssistant Enable-ISHUIQualityAssistant Disable-ISHUIContentEditor Enable-ISHUIContentEditor Disable-ISHExternalPreview Enable-ISHExternalPreview Set-ISHContentEditor Test-ISHContentEditor Get-ISHPackageFolderPath Set-ISHUIEventMonitorTab Move-ISHUIEventMonitorTab Remove-ISHUIEventMonitorTab Remove-ISHIntegrationSTSCertificate Set-ISHIntegrationSTSCertificate Save-ISHIntegrationSTSConfigurationPackage Set-ISHIntegrationSTSWSFederation Set-ISHIntegrationSTSWSTrust Save-ISHIntegrationDBSTSSQLServerConfiguration Clear-ISHDeploymentHistory Get-ISHDeployment Get-ISHDeploymentHistory Undo-ISHDeployment Set-ISHAPIWCFServiceCertificate</d:Cmdlets>
            <d:Functions/>
            <d:DscResources/>
            <d:RoleCapabilities/>
            <d:GUID>68ae5b26-edc0-453a-a720-ecc99d9b603e</d:GUID>
            <d:PowerShellVersion>3.0</d:PowerShellVersion>
            <d:PowerShellHostVersion m:null="true" />
            <d:DotNetFrameworkVersion>4.5</d:DotNetFrameworkVersion>
            <d:CLRVersion>4.0</d:CLRVersion>
            <d:ProcessorArchitecture m:null="true" />
            <d:CompanyName>SDL plc</d:CompanyName>
            <d:Owners>SDL</d:Owners>
        </m:properties>
    </entry>
</feed> 

我將其與另一個模塊進行了比較,但找不到任何重要的重大差異。 看起來此輸出中的某些內容將停止其余的執行。 xml中的某些內容被解釋為腳本實體,盡管xml明確指出這是一個模塊

<d:ItemType>Module</d:ItemType>

要發布的模塊清單是

#
# Module manifest for module 'ISHDeploy.12.0.0'
#
# Generated by: SDL plc
#
# Generated on: 01-Aug-16
#

@{

# Script module or binary module file associated with this manifest.
RootModule = 'ISHDeploy.12.0.0'

# Version number of this module.
ModuleVersion = '0.2'

# ID used to uniquely identify this module
GUID = '68ae5b26-edc0-453a-a720-ecc99d9b603e'


# Author of this module
Author = 'SDL plc'

# Company or vendor of this module
CompanyName = 'SDL plc'

# Copyright statement for this module
Copyright = 'SDL plc. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Deployment automation module for SDL Knowledge Center  Content Manager 12.0.0 (LiveContent Architect, Trisoft InfoShare)'


# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'

# Name of the Windows PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the Windows PowerShell host required by this module
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module
DotNetFrameworkVersion = '4.5'

# Minimum version of the common language runtime (CLR) required by this module
CLRVersion = '4.0'

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
# RequiredModules = @()

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# Functions to export from this module
FunctionsToExport = '*'

# Cmdlets to export from this module
CmdletsToExport = '*'

# Variables to export from this module
VariablesToExport = '*'

# Aliases to export from this module
AliasesToExport = '*'

# DSC resources to export from this module
# DscResourcesToExport = @()

# List of all modules packaged with this module
# ModuleList = @()

# List of all files packaged with this module
# FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{

    PSData = @{

        # Tags applied to this module. These help with module discovery in online galleries.
        # Tags = @()


        # A URL to the license for this module.
        # LicenseUri = ''

        # A URL to the main website for this project.
        # ProjectUri = ''

        # A URL to an icon representing this module.
        # IconUri = ''

        # ReleaseNotes of this module
        # ReleaseNotes = ''

    } # End of PSData hashtable

} # End of PrivateData hashtable

# HelpInfo URI of this module
HelpInfoURI = 'https://sdl.github.io/ISHDeploy/12.0.0/'


# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}

我驗證了GUID是相同的,以防萬一對於畫廊來說很重要

結論我從下面的答案中復制了摘要

總結是,畫廊中沒有標簽的模塊也會被評估為腳本並阻止Publish-Module

我發現了問題所在。 實際上,這是PackageManagement上的錯誤

總結是,畫廊中沒有標簽的模塊也會被評估為腳本並阻止Publish-Module

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM