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-VSTeamBuildDefinition fails #155

Closed
botterberg opened this issue Apr 25, 2019 · 4 comments
Closed

Get-VSTeamBuildDefinition fails #155

botterberg opened this issue Apr 25, 2019 · 4 comments

Comments

@botterberg
Copy link

Steps to reproduce

`Get-VSTeamBuildDefinition -Project my-project'

Get the following error

`The property 'variables' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\VSTeam\6.2.0\Classes\VSTeamBuildDefinition.ps1:35 char:7

  •   $this.Variables = $obj.variables
    
  •   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
    • FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'variables' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\VSTeam\6.2.0\Classes\VSTeamBuildDefinition.ps1:35 char:7

  •   $this.Variables = $obj.variables
    
  •   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
    • FullyQualifiedErrorId : PropertyNotFoundStrict`

VSTeamVersionTable
ServiceFabricEndpoint 5.0-preview Build 5.0 ExtensionsManagement 5.1-preview Release 5.1-preview Version VSTS MemberEntitlementManagement 5.1-preview Packaging 5.1-preview Tfvc 5.0 Git 5.1-preview Core 5.0 Graph 5.1-preview DistributedTask 5.0-preview

PSVersionTable
PSVersion 5.1.17134.590 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.17134.590 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

@DarqueWarrior
Copy link
Collaborator

Are you connecting to TFS or AzD? If TFS or AzD Server what version?

@DarqueWarrior
Copy link
Collaborator

Need a little more details. I just tested version 6.2.1 with TFS 2017, TFS 2018 and AzD. All worked.

@RPhay
Copy link
Contributor

RPhay commented May 15, 2019

I've encountered this as well running over hundreds of build definitions in our Azure DevOps projects. The workaround is simply to wrap the line in a quick check at line 35:

  if ( $obj.PSObject.Properties.name -match 'Variables' ) {
     $this.Variables = $obj.variables
  }

@botterberg
Copy link
Author

I was running against Azure DevOps.

DarqueWarrior pushed a commit that referenced this issue May 16, 2019
* Update VSTeamBuildDefinition.ps1

Added check for existence of $obj.variables which does not exist in all cases.  This resolves issue 155 (#155)

* Update VSTeamBuildDefinitionProcessPhase.ps1

Fixes issue when $obj.steps property does not exist (rare, but it does happen).  No associated issue # (that I'm aware of).

* Updating changelog and version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants