首页 > 解决方案 > 将脚本发布到 Powershell 库失败

问题描述

我有想要发布到 powershell 库的 PS 脚本。在尝试命令时,我得到以下错误。不知道从这里检查什么。有什么线索吗?

Command:
Publish-Script -Path .\NameOfScript.ps1 -NuGetApiKey 'key' -Verbose

Log:
VERBOSE: Performing the operation "Publish-Script" on target "Version '1.0.0' of script 'NameOfScript'".
Publish-PSArtifactUtility : Failed to publish script 'NameOfScript': 'The underlying connection was closed: An unexpected error occurred on a send.
'.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:2875 char:17
+ ...               Publish-PSArtifactUtility -PSScriptInfo $PSScriptInfo `
+                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : FailedToPublishTheScript,Publish-PSArtifactUtility

标签: powershellpowershell-4.0

解决方案


这似乎是断断续续的!重新启动 PS 会话后工作。


推荐阅读