- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将我的 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 : Failed to publish module 'Framework.Logging': 'Publishing to a ******** package management feed 'https://xxx.pkgs.visualstudio.com/_packaging/PowershellModules/nuget/v2' requires it to be registered as a NuGet package source. Retry after adding this source
'https://xxx.pkgs.visualstudio.com/_packaging/PowershellModules/nuget/v2' as NuGet package source by following the instructions specified at 'https://go.microsoft.com/fwlink/?LinkID=698608''. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.1.2.0\PSModule.psm1:1227 char:17 + Publish-PSArtifactUtility -PSModuleInfo $moduleInfo ` + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : FailedToPublishTheModule,Publish-PSArtifactUtility
最佳答案
调用此命令以使用 NuGet.exe 工具添加包源:
.\nuget.exe sources add -name [sourcename, such as myPSModuleFeed] -source https://[account].pkgs.visualstudio.com/_packaging/[feedname]/nuget/v2 -username test -password [PAT] -storePasswordInClearText
关于powershell - 使用 Publish-Module 将 Powershell 模块发布到 VSTS 包管理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44975744/
我是一名优秀的程序员,十分优秀!