Skip to content

Commit

Permalink
Get-ADOTest: Carrying along TestPlanname, attempting PSTypename fix f…
Browse files Browse the repository at this point in the history
…or TestPoint.
  • Loading branch information
StartAutomating committed Apr 15, 2021
1 parent ba9d086 commit ee66fd3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Get-ADOTest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
$q = [Collections.Queue]::new()
}
process {
$q.Enqueue(@{PSParameterSet=$psCmdlet.ParameterSetName} + $PSBoundParameters)
$q.Enqueue(@{PSParameterSet=$psCmdlet.ParameterSetName;InputObject=$_} + $PSBoundParameters)
}
end {
$c, $t, $progId = 0, $q.Count, [Random]::new().Next()
Expand Down Expand Up @@ -154,15 +154,20 @@

$typeName = @($psParameterSet -split '/' -notlike '{*}')[-1] -replace
'\{' -replace '\}' -replace 'ies$', 'y' -replace 's$' -replace 'ID$' -replace
'(Plan|Run|Suite|Configuration|Point|Attachment|Result)', 'Test$0'
'(TestPlan|Plan|Run|Suite|Configuration|TestPoint|Attachment|Result)', 'Test$0'

$additionalProperty = @{
Organization = $Organization
Project = $Project
Server = $Server
}
if ($ProjectID) { $additionalProperty.ProjectID = $ProjectID }
if ($TestPlanID) { $additionalProperty.TestPlanID = $TestPlanID }
if ($TestPlanID) {
$additionalProperty.TestPlanID = $TestPlanID
}
if ($inputObject.TestPlanName) {
$additionalProperty['TestPlanName'] = $inputObject.TestPlanName
}
if ($TestSuiteID) { $additionalProperty.TestSuiteID = $TestSuiteID }
Invoke-ADORestAPI @invokeParams -uri $uri -PSTypeName "$Organization.$typeName",
"PSDevOps.$typeName" -Property $additionalProperty
Expand Down

0 comments on commit ee66fd3

Please sign in to comment.