-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
1,287 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!-- #include "./common/header.md" --> | ||
|
||
# Add-VSTeamMembership | ||
|
||
## SYNOPSIS | ||
|
||
<!-- #include "./synopsis/Add-VSTeamMembership.md" --> | ||
|
||
## SYNTAX | ||
|
||
## DESCRIPTION | ||
|
||
<!-- #include "./synopsis/Add-VSTeamMembership.md" --> | ||
|
||
## EXAMPLES | ||
|
||
## PARAMETERS | ||
|
||
<!-- #include "./params/memberDescriptor.md" --> | ||
|
||
<!-- #include "./params/containerDescriptor.md" --> | ||
|
||
## INPUTS | ||
|
||
## OUTPUTS | ||
|
||
## NOTES | ||
|
||
## RELATED LINKS | ||
|
||
[Get-VsTeamUser](Get-VsTeamUser.md) | ||
|
||
[Get-VsTeamGroup](Get-VsTeamGroup.md) | ||
|
||
[Get-VsTeamMembership](Get-VsTeamMembership.md) | ||
|
||
[Remove-VsTeamMembership](Remove-VsTeamMembership.md) | ||
|
||
[Test-VsTeamMembership](Test-VsTeamMembership.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<!-- #include "./common/header.md" --> | ||
|
||
# Get-VSTeamMembership | ||
|
||
## SYNOPSIS | ||
|
||
<!-- #include "./synopsis/Get-VSTeamMembership.md" --> | ||
|
||
## SYNTAX | ||
|
||
## DESCRIPTION | ||
|
||
<!-- #include "./synopsis/Get-VSTeamMembership.md" --> | ||
|
||
## EXAMPLES | ||
### -------------------------- EXAMPLE 1 -------------------------- | ||
|
||
```PowerShell | ||
(Get-VSTeamMembership -MemberDescriptor $user.ID).value | % { Get-VSTeamGroup -Descriptor $_.containerdescriptor } | ||
``` | ||
Get all the groups for a user | ||
|
||
### -------------------------- EXAMPLE 2 -------------------------- | ||
```PowerShell | ||
(Get-VSTeamMembership -ContainerDescriptor $group.id).value | % {Get-VSTeamUser -Descriptor $_.memberDescriptor } | ||
``` | ||
|
||
Get all the members for a group | ||
|
||
## PARAMETERS | ||
|
||
### -ContainerDescriptor | ||
|
||
A container descriptor retrieved by Get-VsTeamGroup | ||
|
||
```yaml | ||
Type: String | ||
Required: True | ||
Parameter Sets: ByContainerId | ||
Position: 0 | ||
``` | ||
### -MemberDescriptor | ||
A member descriptor retrieved by Get-VsTeamUser | ||
```yaml | ||
Type: String | ||
Required: True | ||
Parameter Sets: ByMemberId | ||
Position: 0 | ||
``` | ||
## INPUTS | ||
## OUTPUTS | ||
## NOTES | ||
## RELATED LINKS | ||
[Get-VsTeamUser](Get-VsTeamUser.md) | ||
[Get-VsTeamGroup](Get-VsTeamGroup.md) | ||
[Add-VsTeamMembership](Add-VsTeamMembership.md) | ||
[Remove-VsTeamMembership](Remove-VsTeamMembership.md) | ||
[Test-VsTeamMembership](Test-VsTeamMembership.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!-- #include "./common/header.md" --> | ||
|
||
# Remove-VSTeamMembership | ||
|
||
## SYNOPSIS | ||
|
||
<!-- #include "./synopsis/Remove-VSTeamMembership.md" --> | ||
|
||
## SYNTAX | ||
|
||
## DESCRIPTION | ||
|
||
<!-- #include "./synopsis/Remove-VSTeamMembership.md" --> | ||
|
||
## EXAMPLES | ||
|
||
## PARAMETERS | ||
|
||
<!-- #include "./params/memberDescriptor.md" --> | ||
|
||
<!-- #include "./params/containerDescriptor.md" --> | ||
|
||
## INPUTS | ||
|
||
## OUTPUTS | ||
|
||
## NOTES | ||
|
||
## RELATED LINKS | ||
|
||
[Get-VsTeamUser](Get-VsTeamUser.md) | ||
|
||
[Get-VsTeamGroup](Get-VsTeamGroup.md) | ||
|
||
[Add-VsTeamMembership](Add-VsTeamMembership.md) | ||
|
||
[Get-VsTeamMembership](Get-VsTeamMembership.md) | ||
|
||
[Test-VsTeamMembership](Test-VsTeamMembership.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!-- #include "./common/header.md" --> | ||
|
||
# Test-VSTeamMembership | ||
|
||
## SYNOPSIS | ||
|
||
<!-- #include "./synopsis/Test-VSTeamMembership.md" --> | ||
|
||
## SYNTAX | ||
|
||
## DESCRIPTION | ||
|
||
<!-- #include "./synopsis/Test-VSTeamMembership.md" --> | ||
|
||
## EXAMPLES | ||
|
||
## PARAMETERS | ||
|
||
<!-- #include "./params/memberDescriptor.md" --> | ||
|
||
<!-- #include "./params/containerDescriptor.md" --> | ||
|
||
## INPUTS | ||
|
||
## OUTPUTS | ||
### $True or $False | ||
|
||
## NOTES | ||
|
||
## RELATED LINKS | ||
|
||
[Get-VsTeamUser](Get-VsTeamUser.md) | ||
|
||
[Get-VsTeamGroup](Get-VsTeamGroup.md) | ||
|
||
[Add-VsTeamMembership](Add-VsTeamMembership.md) | ||
|
||
[Get-VsTeamMembership](Get-VsTeamMembership.md) | ||
|
||
[Remove-VsTeamMembership](Remove-VsTeamMembership.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### -ContainerDescriptor | ||
|
||
A container descriptor retrieved by Get-VsTeamGroup | ||
|
||
```yaml | ||
Type: String | ||
Required: True | ||
Position: 1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### -MemberDescriptor | ||
|
||
A member descriptor retrieved by Get-VsTeamUser | ||
|
||
```yaml | ||
Type: String | ||
Required: True | ||
Position: 0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Adds a membership to a container. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Gets a memberships for a container or member. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Removes a membership to a container. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Tests the membership in a container. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
function _callMembershipAPI { | ||
[CmdletBinding()] | ||
param( | ||
[Parameter(Mandatory = $true)] | ||
[string] $Id, | ||
[ValidateSet('Get', 'Post', 'Patch', 'Delete', 'Options', 'Put', 'Default', 'Head', 'Merge', 'Trace')] | ||
[string] $Method, | ||
[ValidateSet('', 'Up', 'Down')] | ||
[string] $Direction | ||
) | ||
Set-StrictMode -Version Latest | ||
|
||
# This will throw if this account does not support the graph API | ||
_supportsGraph | ||
|
||
Write-Verbose "Getting members for $Id" | ||
|
||
$query = @{} | ||
if ($Direction) { | ||
$query['direction'] = $Direction | ||
} | ||
|
||
# Call the REST API | ||
$resp = _callAPI -Area 'graph' -Resource 'memberships' ` | ||
-Id $Id ` | ||
-SubDomain "vssps" ` | ||
-Method $Method ` | ||
-Version $([VSTeamVersions]::Graph) ` | ||
-QueryString $query | ||
|
||
return $resp | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function Add-VSTeamMembership { | ||
[CmdletBinding()] | ||
param( | ||
[Parameter(Mandatory = $true)] | ||
[string] $MemberDescriptor, | ||
[Parameter(Mandatory = $true)] | ||
[string] $ContainerDescriptor, | ||
[switch] $DontTest | ||
) | ||
|
||
process { | ||
return _callMembershipAPI -Id "$MemberDescriptor/$ContainerDescriptor" -Method Put | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
function Get-VSTeamMembership { | ||
[CmdletBinding()] | ||
param( | ||
[Parameter(Mandatory = $true, ValueFromPipeline, ValueFromPipelineByPropertyName,ParameterSetName="ByContainerId")] | ||
[string] $ContainerDescriptor, | ||
[Parameter(Mandatory = $true, ValueFromPipeline, ValueFromPipelineByPropertyName,ParameterSetName="ByMemberId")] | ||
[string] $MemberDescriptor | ||
) | ||
|
||
process { | ||
if ($MemberDescriptor) { | ||
return _callMembershipAPI -Id $MemberDescriptor -Method Get -Direction Up | ||
} else { | ||
return _callMembershipAPI -Id $ContainerDescriptor -Method Get -Direction Down | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function Remove-VSTeamMembership { | ||
[CmdletBinding()] | ||
param( | ||
[Parameter(Mandatory = $true)] | ||
[string] $MemberDescriptor, | ||
[Parameter(Mandatory = $true)] | ||
[string] $ContainerDescriptor | ||
) | ||
|
||
process { | ||
return _callMembershipAPI -Id "$MemberDescriptor/$ContainerDescriptor" -Method Delete | ||
} | ||
} |
Oops, something went wrong.