【发布时间】:2017-12-12 01:05:02
【问题描述】:
我正在尝试将我的 Powershell 模块发布到 VSTS 包管理提要。到目前为止,我有:
$securePass = ConvertTo-SecureString -String $RepositoryPassword -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ($RepositoryUsername, $securePass)
Write-Debug "Adding the Repository $RepositoryName"
Register-PSRepository -Name $RepositoryName -SourceLocation $RepositorySourceUri `
-PublishLocation $RepositoryPublishUri -Credential $cred `
-PackageManagementProvider Nuget -InstallationPolicy Trusted
$PublishParams = @{
Path = $ModuleFolderPath
ProjectUri = $ProjectUri
Tags = $ModuleTags
Repository = $RepositoryName
NugetApiKey = $NugetApiKey
}
Publish-Module @PublishParams -Force -Verbose
但是,我收到以下错误:
Publish-PSArtifactUtility:发布模块失败 'Framework.Logging': '发布到 ******** 包管理 喂养 'https://xxx.pkgs.visualstudio.com/_packaging/PowershellModules/nuget/v2' 要求将其注册为 NuGet 包源。之后重试 添加此来源
'https://xxx.pkgs.visualstudio.com/_packaging/PowershellModules/nuget/v2' 按照指定的说明作为 NuGet 包源 'https://go.microsoft.com/fwlink/?LinkID=698608''。在 C:\程序 文件\WindowsPowerShell\Modules\PowerShellGet\1.1.2.0\PSModule.psm1:1227 字符:17 + 发布-PSArtifactUtility -PSModuleInfo $moduleInfo ` + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ + 分类信息 : InvalidOperation: (:) [Write-Error], WriteErrorException + 完全限定错误 ID: FailedToPublishTheModule,Publish-PSArtifactUtility
PSRepository 在创建时作为源 Uris 和发布 Uris 传递 https://xxx.pkgs.visualstudio.com/_packaging/PowershellModules/nuget/v2。关于我哪里出错的任何指示?
【问题讨论】:
标签: powershell azure-devops package-managers