Skip to content

Commit

Permalink
added team name to _buildRequestURI and _callAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianSchuetze committed Oct 3, 2019
1 parent 537cc3b commit c0ebf04
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Source/Private/common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function _hasAccount {
function _buildRequestURI {
[CmdletBinding()]
param(
[string]$team,
[string]$resource,
[string]$area,
[string]$id,
Expand All @@ -90,6 +91,10 @@ function _buildRequestURI {
$sb.Append("/$projectName") | Out-Null
}

if ($team) {
$sb.Append("/$team") | Out-Null
}

$sb.Append("/_apis/") | Out-Null

if ($area) {
Expand Down Expand Up @@ -588,8 +593,9 @@ function _callAPI {
[object]$body,
[string]$InFile,
[string]$OutFile,
[string]$ContentType,
[string]$ContentType,
[string]$ProjectName,
[string]$Team,
[string]$Url,
[object]$QueryString
)
Expand Down Expand Up @@ -628,7 +634,7 @@ function _callAPI {
}

# We have to remove any extra parameters not used by Invoke-RestMethod
$extra = 'Area', 'Resource', 'SubDomain', 'Id', 'Version', 'JSON', 'ProjectName', 'Url', 'QueryString'
$extra = 'Area', 'Resource', 'SubDomain', 'Id', 'Version', 'JSON', 'ProjectName', 'Team', 'Url', 'QueryString'
foreach ($e in $extra) { $params.Remove($e) | Out-Null }

try {
Expand Down

0 comments on commit c0ebf04

Please sign in to comment.