Skip to content

Commit

Permalink
Fixing issue #90
Browse files Browse the repository at this point in the history
Set top to 10,000 when searching by email
Updated help for Update-VSTeamUser
Fixed issue where api version was not being set on load.
  • Loading branch information
DarqueWarrior committed Sep 16, 2018
1 parent 2223374 commit b651947
Show file tree
Hide file tree
Showing 8 changed files with 176 additions and 10 deletions.
29 changes: 26 additions & 3 deletions .docs/Update-VSTeamUser.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,38 @@

## SYNOPSIS

Updates the users for the account. (Currently only supports updating the LicenseType)
<!-- #include "./synopsis/Update-VSTeamUser.md" -->

## SYNTAX

## DESCRIPTION

Updates the users for the account. (Currently only supports updating the LicenseType)
<!-- #include "./synopsis/Update-VSTeamUser.md" -->

## 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:
Expand All @@ -30,13 +50,16 @@ Type of Account License you want to change to. The acceptable values for this pa
```yaml
Type: String
Required: True
Default value: [empty]
```
<!-- #include "./params/force.md" -->
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS
[Get-VSTeamUser](Get-VSTeamUser.md)
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion VSTeam.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
RootModule = ''

# Version number of this module.
ModuleVersion = '4.0.6'
ModuleVersion = '4.0.7'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
30 changes: 29 additions & 1 deletion docs/Update-VSTeamUser.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -42,3 +69,4 @@ Default value: [empty]
## RELATED LINKS
[Get-VSTeamUser](Get-VSTeamUser.md)
114 changes: 111 additions & 3 deletions en-US/VSTeam-Help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14375,6 +14375,18 @@ Demo-CI Demo-CI-45 notStarted</dev:code>
<command:syntax>
<command:syntaxItem>
<maml:name>Update-VSTeamUser</maml:name>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named" aliases="none">
<maml:name>Id</maml:name>
<maml:Description>
<maml:para>The id of the user to be updated.</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named" aliases="none">
<maml:name>License</maml:name>
<maml:Description>
Expand All @@ -14391,11 +14403,90 @@ Demo-CI Demo-CI-45 notStarted</dev:code>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>[empty]</dev:defaultValue>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named" aliases="none">
<maml:name>Force</maml:name>
<maml:Description>
<maml:para>Forces the command without confirmation</maml:para>
</maml:Description>
<dev:type>
<maml:name>SwitchParameter</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>Update-VSTeamUser</maml:name>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named" aliases="none">
<maml:name>Email</maml:name>
<maml:Description>
<maml:para>The email address of the user to update. For organizations with over 100 users this can be very slow and resource intensive.</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named" aliases="none">
<maml:name>License</maml:name>
<maml:Description>
<maml:para>Type of Account License you want to change to. The acceptable values for this parameter are:</maml:para>
<maml:para>- Advanced</maml:para>
<maml:para>- EarlyAdopter</maml:para>
<maml:para>- Express</maml:para>
<maml:para>- None</maml:para>
<maml:para>- Professional</maml:para>
<maml:para>- StakeHolder</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named" aliases="none">
<maml:name>Force</maml:name>
<maml:Description>
<maml:para>Forces the command without confirmation</maml:para>
</maml:Description>
<dev:type>
<maml:name>SwitchParameter</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named" aliases="none">
<maml:name>Id</maml:name>
<maml:Description>
<maml:para>The id of the user to be updated.</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named" aliases="none">
<maml:name>Email</maml:name>
<maml:Description>
<maml:para>The email address of the user to update. For organizations with over 100 users this can be very slow and resource intensive.</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named" aliases="none">
<maml:name>License</maml:name>
<maml:Description>
Expand All @@ -14412,7 +14503,19 @@ Demo-CI Demo-CI-45 notStarted</dev:code>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>[empty]</dev:defaultValue>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named" aliases="none">
<maml:name>Force</maml:name>
<maml:Description>
<maml:para>Forces the command without confirmation</maml:para>
</maml:Description>
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
<dev:type>
<maml:name>SwitchParameter</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
</command:parameters>
<command:inputTypes />
Expand All @@ -14423,6 +14526,11 @@ Demo-CI Demo-CI-45 notStarted</dev:code>
</maml:alert>
</maml:alertSet>
<command:examples />
<command:relatedLinks />
<command:relatedLinks>
<maml:navigationLink>
<maml:linkText>Get-VSTeamUser</maml:linkText>
<maml:uri></maml:uri>
</maml:navigationLink>
</command:relatedLinks>
</command:command>
</helpItems>
3 changes: 3 additions & 0 deletions src/team.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/teamspsdrive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/users.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit b651947

Please sign in to comment.