powershell - 将脚本发布到 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
解决方案
这似乎是断断续续的!重新启动 PS 会话后工作。
推荐阅读
- macos - 运行 mix phx.server 时找不到可执行的“mac_listener”
- javascript - 如果在 Firefox 浏览器中放置下一个,lightgallery 将关闭
- python - 如何将 iot 设备连接到我电脑中的 django 服务器?
- php - VueJS axios 上传图片
- yocto - 获取包时如何将机器设置为 Yocto 的镜像服务器?
- peoplesoft - Peoplesoft 传入字符串数组作为参数
- python - Robot Framework 的 SeleniumLibrary 抛出错误“chromedriver.exe 不是受支持的浏览器”
- angular - 功能单元测试中未涵盖的 if 语句 - Jasmine
- python - 在 dask.read_sql_table 中添加 application_name 作为参数时出错
- java - 如何使用设置首选项禁用通知?