Skip to content

Commit

Permalink
Update VSTeamBuildDefinition.ps1 (#158)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
RPhay authored and DarqueWarrior committed May 16, 2019
1 parent 8dbb208 commit 5d707a8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 6.2.2

Merged [Pull Request](https://github.com/DarqueWarrior/vsteam/pull/158) from [Ryan](https://github.com/RPhay) which included the following:

Fixes issue [Get-VSTeamBuildDefinition fails #155](https://github.com/DarqueWarrior/vsteam/issues/155)

## 6.2.1

Merged [Pull Request](https://github.com/DarqueWarrior/vsteam/pull/156) from [Daniel Sturm](https://github.com/danstur) which included the following:
Expand Down
6 changes: 4 additions & 2 deletions Source/Classes/VSTeamBuildDefinition.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class VSTeamBuildDefinition : VSTeamDirectory {
$this.id = $obj.id
$this.Path = $obj.path
$this.Revision = $obj.revision
$this.Variables = $obj.variables
if ( $obj.PSObject.Properties.name -match 'Variables' ) {
$this.Variables = $obj.variables
}
$this.CreatedOn = $obj.createdDate
$this.JobAuthorizationScope = $obj.jobAuthorizationScope
$this.AuthoredBy = [VSTeamUserEntitlement]::new($obj.authoredBy, $Projectname)
Expand Down Expand Up @@ -111,4 +113,4 @@ class VSTeamBuildDefinition : VSTeamDirectory {
return $this.Process
}
}
}
}
10 changes: 6 additions & 4 deletions Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ class VSTeamBuildDefinitionProcessPhase : VSTeamDirectory {
}

$this.StepCount = 0
foreach ($step in $obj.steps) {
$this.StepCount++
$this.Steps += [VSTeamBuildDefinitionProcessPhaseStep]::new($step, $this.StepCount, $Projectname)
if ( $obj.PSObject.Properties.name -match 'steps' ) {
foreach ($step in $obj.steps) {
$this.StepCount++
$this.Steps += [VSTeamBuildDefinitionProcessPhaseStep]::new($step, $this.StepCount, $Projectname)
}
}

$this._internalObj = $obj
Expand All @@ -37,4 +39,4 @@ class VSTeamBuildDefinitionProcessPhase : VSTeamDirectory {
[object[]] GetChildItem() {
return $this.Steps
}
}
}
2 changes: 1 addition & 1 deletion Source/VSTeam.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'VSTeam.psm1'

# Version number of this module.
ModuleVersion = '6.2.1'
ModuleVersion = '6.2.2'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down

0 comments on commit 5d707a8

Please sign in to comment.