Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update-VSTeamNuGetPackageVersion added missing project parameter #422

Merged
merged 1 commit into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Source/Public/Update-VSTeamNuGetPackageVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ function Update-VSTeamNuGetPackageVersion {
[parameter(Mandatory = $true)]
[bool] $isListed,

[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[vsteam_lib.ProjectValidateAttribute($false)]
[ArgumentCompleter([vsteam_lib.ProjectCompleter])]
[string] $ProjectName,

[switch] $Force
)
process {
Expand All @@ -29,6 +34,7 @@ function Update-VSTeamNuGetPackageVersion {
$body = $obj | ConvertTo-Json -Compress -Depth 100

_callAPI -Method PATCH -SubDomain pkgs `
-ProjectName $ProjectName `
-Area "packaging/feeds/$FeedId/nuget" `
-Resource "packages/$PackageName/versions" `
-Id $item `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Describe 'VSTeamNuGetPackageVersion' {
# resourceName : Versions
# routeTemplate : {project}/_apis/packaging/feeds/{feedId}/{area}/packages/{packageName}/{resource}/{packageVersion}
It 'Should unlist version' {
Update-VSTeamNuGetPackageVersion -FeedId 'feedName' -packageName 'packageName' -packageVersion '1137.0.0' -isListed $false -Force
Update-VSTeamNuGetPackageVersion -FeedId 'feedName' -packageName 'packageName' -packageVersion '1137.0.0' -isListed $false -Force -ProjectName project

Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter {
$Method -eq 'Patch' -and
Expand Down