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

Get-VSTeamBuildArtifact fails #148

Closed
apobekiaris opened this issue Mar 8, 2019 · 8 comments · Fixed by #257
Closed

Get-VSTeamBuildArtifact fails #148

apobekiaris opened this issue Mar 8, 2019 · 8 comments · Fixed by #257
Labels
bug when a bug has been identified or filed

Comments

@apobekiaris
Copy link

Hi

I am executing the next script

$build = (Get-VSTeamBuild -ProjectName eXpandFramework|Where-Object {$_.DefinitionName -like "Xpand-Lab" -and $_.Result -eq "succeeded"}|Select-Object -First 1)
Get-VSTeamBuildArtifact -ProjectName eXpandFramework -Id $build.id 

however there is an exception in the output

The property 'properties' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\VSTeam\6.1.0\Private\applyTypes.ps1:93 char:7
+       $item.resource.properties.PSObject.TypeNames.Insert(0, 'Team.Bu ...
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict


id   : 232
name : Xpand.v18.2.601.10


id   : 233
name : build.SourceLabel

and is still not clear how do I download the artifacts.

@DarqueWarrior DarqueWarrior added the bug when a bug has been identified or filed label Mar 8, 2019
@DarqueWarrior
Copy link
Collaborator

I think this has to do with upgrading the version of the API we use by default. I have noticed some properties have moved around. I will look into it now.

@DarqueWarrior
Copy link
Collaborator

Please run the following command and report the results.

Get-VSTeamAPIVersion

@apobekiaris
Copy link
Author

Name                           Value
----                           -----
ServiceFabricEndpoint
Build                          3.0
ExtensionsManagement           3.0-preview
Release                        3.0-preview
Version                        TFS2017
MemberEntitlementManagement
Packaging
Tfvc                           3.0
Git                            3.0
Core                           3.0
Graph
DistributedTask                3.0-preview

@apobekiaris
Copy link
Author

@DarqueWarrior any updates on this case?

looks like if I ErrorAction Continue I get a valid download Url

@DarqueWarrior
Copy link
Collaborator

Are you connected to a TFS2017 server?

@apobekiaris
Copy link
Author

i try to download artifact from a Azure DevOps Hosted Agent pipeline, checking the pipeline setup it looks like it throws if the pipeline uses the Publish PipeLine Artifacts task instead when I used the Publish build artifact task I was able to get a valid DownloadUrl. For me this solution is fine, thanks for the support.

@DarqueWarrior
Copy link
Collaborator

The reason I asked is because the version of the API you were using was for TFS2017. Call SetVSTeamAPIVersion and set to AzD and try again.

@markwragg
Copy link
Contributor

I've raised a PR that should fix this issue:

#232

It occurs because the API is returning an extra result after all the artifact that is a different type (its called GitRef) and doesn't have a sub property named "properties":

image

My PR adds an extra condition to the if statement that ignores results from the API that don't have a .properties property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug when a bug has been identified or filed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants