From 8b4d240370645b7680a62410ac211b96397e61de Mon Sep 17 00:00:00 2001 From: Andy Neillans Date: Fri, 28 Jul 2017 15:41:21 +0100 Subject: [PATCH 1/3] Fixed for on-premise URLS being incorrectly classed as VSTS accounts; fix for projects validation if you have more than 100 projects. --- src/common.ps1 | 2 +- src/team.psm1 | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common.ps1 b/src/common.ps1 index 7a0c98393..7fddf92ff 100644 --- a/src/common.ps1 +++ b/src/common.ps1 @@ -94,7 +94,7 @@ function _getProjects { $instance = $env:TEAM_ACCT # Build the url to list the projects - $listurl = $instance + '/_apis' + $resource + '?api-version=' + $version + $listurl = $instance + '/_apis' + $resource + '?api-version=' + $version + '&$top=9999' Write-Verbose "listurl = $listurl" # Call the REST API diff --git a/src/team.psm1 b/src/team.psm1 index f0b3fa3bd..1738f3469 100644 --- a/src/team.psm1 +++ b/src/team.psm1 @@ -158,8 +158,10 @@ function Add-TeamAccount { } # If they only gave an account name add visualstudio.com - if($Account -match "(?https?\://)?(?[A-Z0-9][-A-Z0-9]*[A-Z0-9])(?\.visualstudio\.com)?") { - $Account = "https://$($matches.account).visualstudio.com" + if ($Account -notcontains "/") { + if($Account -match "(?https?\://)?(?[A-Z0-9][-A-Z0-9]*[A-Z0-9])(?\.visualstudio\.com)?") { + $Account = "https://$($matches.account).visualstudio.com" + } } $encodedPat = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(":$_pat")) From 891f61ebd605ee480eb5e8b6a0c34182fad6b155 Mon Sep 17 00:00:00 2001 From: Andy Neillans Date: Fri, 28 Jul 2017 15:48:08 +0100 Subject: [PATCH 2/3] It's powershell. Keep forgetting -contains isn't what you think. --- src/team.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/team.psm1 b/src/team.psm1 index 1738f3469..872b9f54f 100644 --- a/src/team.psm1 +++ b/src/team.psm1 @@ -158,7 +158,7 @@ function Add-TeamAccount { } # If they only gave an account name add visualstudio.com - if ($Account -notcontains "/") { + if ($Account -notlike "*/*") { if($Account -match "(?https?\://)?(?[A-Z0-9][-A-Z0-9]*[A-Z0-9])(?\.visualstudio\.com)?") { $Account = "https://$($matches.account).visualstudio.com" } From 681c8959a63248e4b0d94850af0ae74972f35dfa Mon Sep 17 00:00:00 2001 From: Donovan Brown Date: Fri, 4 Aug 2017 20:13:27 -0500 Subject: [PATCH 3/3] Setting version --- Team.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Team.psd1 b/Team.psd1 index 088af2e94..f951b8899 100644 --- a/Team.psd1 +++ b/Team.psd1 @@ -13,7 +13,7 @@ RootModule = '' # Version number of this module. - ModuleVersion = '0.1.27' + ModuleVersion = '0.1.29' # Supported PSEditions # CompatiblePSEditions = @()