创建 Nuget 包后,Powershell 发布模块到 Powershell Gallery 失败
我正在尝试将 Powershell 模块 的新版本发布到 Powershell Gallery 通过使用
Publish-Module -Name "Nuttercode-PRTG" -NuGetApiKey $apiKey -Verbose -RequiredVersion 1.4
模块 .psm1 和.psd1 文件可以在此处找到。
dotnet.exe 在 {myUserDir}\AppData\Local\Temp\{random number}\Nuttercode-PRTG 中创建包后,它报告:
VERBOSE: finished running C:\Program Files\dotnet\dotnet.exe with exit code 0
VERBOSE: Created Nuget Package
VERBOSE: Successfully created nuget package at
Write-Error: Failed to publish module 'Nuttercode-PRTG': 'Cannot bind argument to parameter 'NupkgPath' because it is an empty string.'.
随后临时文件夹被删除。对我来说,这听起来像是 Publish-Module 或 dotnet.exe 的内部问题,但我不知道发生了什么,也不知道我自己是否做错了什么。我还创建了一个新的 api 密钥以防万一,但这并没有影响结果。
我使用的是 Windows 10 20H2(内部版本 19042.1469)、Powershell 7.2.2、PowerShellGet 2.2.5 和 dotnet.exe 6.0.201。我可以使用 Windows 11 21H2(内部版本 22000.556)、Powershell 7.2.1、PowershellGet 2.2.5 和 dotnet.exe 5.0.102 使用相同的命令和参数在另一台计算机上复制该问题。
I am trying to publish a new version of a Powershell module to the Powershell Gallery by using
Publish-Module -Name "Nuttercode-PRTG" -NuGetApiKey $apiKey -Verbose -RequiredVersion 1.4
The module .psm1 and .psd1 files can be found here.
After dotnet.exe created the package in {myUserDir}\AppData\Local\Temp\{random numbers}\Nuttercode-PRTG it reports:
VERBOSE: finished running C:\Program Files\dotnet\dotnet.exe with exit code 0
VERBOSE: Created Nuget Package
VERBOSE: Successfully created nuget package at
Write-Error: Failed to publish module 'Nuttercode-PRTG': 'Cannot bind argument to parameter 'NupkgPath' because it is an empty string.'.
Afterwards the temp-folder gets deleted. To me this sounds like an internal problem of Publish-Module or dotnet.exe, but I have no idea what is going on or if I am doing something very wrong myself. I also created a new api key just in case but it did not affect the result.
I am using Windows 10 20H2 (Build 19042.1469), Powershell 7.2.2, PowerShellGet 2.2.5, and dotnet.exe 6.0.201. I am able to replicate the problem on another computer using the same command and arguments using Windows 11 21H2 (Build 22000.556), Powershell 7.2.1, PowershellGet 2.2.5, and dotnet.exe 5.0.102.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论