diff --git a/.docs/Update-VSTeamUser.md b/.docs/Update-VSTeamUser.md
index cfa44e68a..47e71b65b 100644
--- a/.docs/Update-VSTeamUser.md
+++ b/.docs/Update-VSTeamUser.md
@@ -4,18 +4,38 @@
## SYNOPSIS
-Updates the users for the account. (Currently only supports updating the LicenseType)
+
## SYNTAX
## DESCRIPTION
-Updates the users for the account. (Currently only supports updating the LicenseType)
+
## EXAMPLES
## PARAMETERS
+### -Id
+
+The id of the user to be updated.
+
+```yaml
+Type: String
+Parameter Sets: ById
+Required: True
+```
+
+### -Email
+
+The email address of the user to update. For organizations with over 100 users this can be very slow and resource intensive.
+
+```yaml
+Type: String
+Parameter Sets: ByEmail
+Required: True
+```
+
### -License
Type of Account License you want to change to. The acceptable values for this parameter are:
@@ -30,9 +50,10 @@ Type of Account License you want to change to. The acceptable values for this pa
```yaml
Type: String
Required: True
-Default value: [empty]
```
+
+
## INPUTS
## OUTPUTS
@@ -40,3 +61,5 @@ Default value: [empty]
## NOTES
## RELATED LINKS
+
+[Get-VSTeamUser](Get-VSTeamUser.md)
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 60191b911..45e43a445 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog
+## 4.0.7
+
+Setting the Top to 10,000 when searching by email in Update-VSTeamUser. If you have a large number of users you should use by ID instead of by email. This addresses issue [90](https://github.com/DarqueWarrior/vsteam/issues/90).
+
## 4.0.6
Fixed bug where you could not Tab complete the build definition name when calling Add-VSTeamBuild.
diff --git a/VSTeam.psd1 b/VSTeam.psd1
index 89dd6b2cd..487ea7bd4 100644
--- a/VSTeam.psd1
+++ b/VSTeam.psd1
@@ -13,7 +13,7 @@
RootModule = ''
# Version number of this module.
- ModuleVersion = '4.0.6'
+ ModuleVersion = '4.0.7'
# Supported PSEditions
# CompatiblePSEditions = @()
diff --git a/docs/Update-VSTeamUser.md b/docs/Update-VSTeamUser.md
index 6d2c2ba0c..dace0be7a 100644
--- a/docs/Update-VSTeamUser.md
+++ b/docs/Update-VSTeamUser.md
@@ -17,6 +17,26 @@ Updates the users for the account. (Currently only supports updating the License
## PARAMETERS
+### -Id
+
+The id of the user to be updated.
+
+```yaml
+Type: String
+Parameter Sets: ById
+Required: True
+```
+
+### -Email
+
+The email address of the user to update. For organizations with over 100 users this can be very slow and resource intensive.
+
+```yaml
+Type: String
+Parameter Sets: ByEmail
+Required: True
+```
+
### -License
Type of Account License you want to change to. The acceptable values for this parameter are:
@@ -31,7 +51,14 @@ Type of Account License you want to change to. The acceptable values for this pa
```yaml
Type: String
Required: True
-Default value: [empty]
+```
+
+### -Force
+
+Forces the command without confirmation
+
+```yaml
+Type: SwitchParameter
```
## INPUTS
@@ -42,3 +69,4 @@ Default value: [empty]
## RELATED LINKS
+[Get-VSTeamUser](Get-VSTeamUser.md)
diff --git a/en-US/VSTeam-Help.xml b/en-US/VSTeam-Help.xml
index 785ec5cba..c810d22f7 100644
--- a/en-US/VSTeam-Help.xml
+++ b/en-US/VSTeam-Help.xml
@@ -14375,6 +14375,18 @@ Demo-CI Demo-CI-45 notStarted
Update-VSTeamUser
+
+ Id
+
+ The id of the user to be updated.
+
+ String
+
+ String
+
+
+ None
+
License
@@ -14391,11 +14403,90 @@ Demo-CI Demo-CI-45 notStarted
String
- [empty]
+ None
+
+
+ Force
+
+ Forces the command without confirmation
+
+
+ SwitchParameter
+
+
+ False
+
+
+
+ Update-VSTeamUser
+
+ Email
+
+ The email address of the user to update. For organizations with over 100 users this can be very slow and resource intensive.
+
+ String
+
+ String
+
+
+ None
+
+
+ License
+
+ Type of Account License you want to change to. The acceptable values for this parameter are:
+ - Advanced
+ - EarlyAdopter
+ - Express
+ - None
+ - Professional
+ - StakeHolder
+
+ String
+
+ String
+
+
+ None
+
+
+ Force
+
+ Forces the command without confirmation
+
+
+ SwitchParameter
+
+
+ False
+
+ Id
+
+ The id of the user to be updated.
+
+ String
+
+ String
+
+
+ None
+
+
+ Email
+
+ The email address of the user to update. For organizations with over 100 users this can be very slow and resource intensive.
+
+ String
+
+ String
+
+
+ None
+
License
@@ -14412,7 +14503,19 @@ Demo-CI Demo-CI-45 notStarted
String
- [empty]
+ None
+
+
+ Force
+
+ Forces the command without confirmation
+
+ SwitchParameter
+
+ SwitchParameter
+
+
+ False
@@ -14423,6 +14526,11 @@ Demo-CI Demo-CI-45 notStarted
-
+
+
+ Get-VSTeamUser
+
+
+
\ No newline at end of file
diff --git a/src/team.psm1 b/src/team.psm1
index 576f10c6b..380c58f4d 100644
--- a/src/team.psm1
+++ b/src/team.psm1
@@ -501,6 +501,9 @@ function Invoke-VSTeamRequest {
# Set the module version
[VSTeamVersions]::ModuleVersion = _getModuleVersion
+# Load the correct version of the environment variable
+Set-VSTeamAPIVersion -Version $([VSTeamVersions]::Version)
+
Set-Alias gti Get-VSTeamInfo
Set-Alias ata Add-VSTeamAccount
Set-Alias ivr Invoke-VSTeamRequest
diff --git a/src/teamspsdrive.ps1 b/src/teamspsdrive.ps1
index 89f2adb62..a71d8c41c 100644
--- a/src/teamspsdrive.ps1
+++ b/src/teamspsdrive.ps1
@@ -65,7 +65,7 @@ using namespace Microsoft.PowerShell.SHiPS
class VSTeamVersions {
static [string] $Account = $env:TEAM_ACCT
static [string] $DefaultProject = $env:TEAM_PROJECT
- static [string] $Version = $env:TEAM_VERSION
+ static [string] $Version = $(If ($env:TEAM_VERSION) {$env:TEAM_VERSION} Else {"TFS2017"})
static [string] $Build = '3.0'
static [string] $Release = '3.0-preview'
static [string] $Core = '3.0'
diff --git a/src/users.psm1 b/src/users.psm1
index a6e55ec65..541ec320e 100644
--- a/src/users.psm1
+++ b/src/users.psm1
@@ -152,7 +152,7 @@ function Update-VSTeamUser
if ($email)
{
# We have to go find the id
- $user = Get-VSTeamUser | Where-Object email -eq $email
+ $user = Get-VSTeamUser -Top 10000 | Where-Object email -eq $email
if (-not$user)
{