-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Get-VSTeamGroup / Get-VSTeamDescriptor (#140)
* Add Get-VSTeamGroup / Get-VSTeamDescriptor * Changed Azure DevOps abbreviation from ADO to AzD. * Got all unit tests for Group and Descriptor passing. * All unit tests updated to work with VSTeamDescriptor type. * Add working -SubjectTypes to Get-VSTeamGroup * Updated gen-help to copy into the Source folder now. * Fixed title in Get-VSTeamDescriptor help. * Defaulting to 5.x api for AzD * Get-VSTeamOptions can get options for any SubDomain * Added code to make sure the account supported the Graph API. * Updating changelog and version.
- Loading branch information
1 parent
b09ae98
commit e6a007a
Showing
39 changed files
with
5,186 additions
and
2,923 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,35 @@ | ||
<!-- #include "./common/header.md" --> | ||
|
||
# Get-VSTeamDescriptor | ||
|
||
## SYNOPSIS | ||
|
||
<!-- #include "./synopsis/Get-VSTeamDescriptor.md" --> | ||
|
||
## SYNTAX | ||
|
||
## DESCRIPTION | ||
|
||
<!-- #include "./synopsis/Get-VSTeamDescriptor.md" --> | ||
|
||
## EXAMPLES | ||
|
||
## PARAMETERS | ||
|
||
### -StorageKey | ||
|
||
Storage key of the subject (user, group, scope, etc.) to resolve | ||
|
||
```yaml | ||
Type: String | ||
Required: True | ||
Parameter Sets: ByStorageKey | ||
``` | ||
## INPUTS | ||
## OUTPUTS | ||
## NOTES | ||
## RELATED LINKS |
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,61 @@ | ||
<!-- #include "./common/header.md" --> | ||
|
||
# Get-VSTeamGroup | ||
|
||
## SYNOPSIS | ||
|
||
<!-- #include "./synopsis/Get-VSTeamGroup.md" --> | ||
|
||
## SYNTAX | ||
|
||
## DESCRIPTION | ||
|
||
<!-- #include "./synopsis/Get-VSTeamGroup.md" --> | ||
|
||
## EXAMPLES | ||
|
||
## PARAMETERS | ||
|
||
<!-- #include "./params/projectName.md" --> | ||
|
||
### -SubjectTypes | ||
|
||
A comma separated list of user subject subtypes to reduce the retrieved results. | ||
Valid subject types: | ||
|
||
- vssgp (Azure DevOps Group) | ||
- aadgp (Azure Active Directory Group) | ||
|
||
```yaml | ||
Type: String[] | ||
Required: False | ||
Parameter Sets: List, ListByProjectName | ||
``` | ||
### -ScopeDescriptor | ||
Specify a non-default scope (collection, project) to search for groups. | ||
```yaml | ||
Type: String | ||
Required: False | ||
Parameter Sets: List | ||
``` | ||
### -Descriptor | ||
The descriptor of the desired graph group. | ||
```yaml | ||
Type: String | ||
Required: False | ||
Parameter Sets: ByGroupDescriptor | ||
``` | ||
## INPUTS | ||
## OUTPUTS | ||
## NOTES | ||
## RELATED LINKS |
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 @@ | ||
Resolve a storage key to a descriptor. |
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 @@ | ||
Returns a Group or List of Groups. |
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,30 @@ | ||
using namespace Microsoft.PowerShell.SHiPS | ||
|
||
[SHiPSProvider(UseCache = $true)] | ||
[SHiPSProvider(BuiltinProgress = $false)] | ||
class VSTeamDescriptor : VSTeamLeaf { | ||
|
||
[string]$Descriptor = $null | ||
[hashtable]$Links = $null | ||
|
||
VSTeamDescriptor ( | ||
[object]$obj | ||
) : base($obj.value, $obj.value, $null) { | ||
|
||
$this.Links = @{ | ||
'Self' = $obj._links.self.href; | ||
'StorageKey' = $obj._links.storageKey.href; | ||
'Subject'= $obj._links.subject.href; | ||
} | ||
|
||
$this.Descriptor = $obj.value | ||
|
||
$this._internalObj = $obj | ||
|
||
$this.AddTypeName('Team.Descriptor') | ||
} | ||
|
||
[string]ToString() { | ||
return $this.Descriptor | ||
} | ||
} |
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,20 @@ | ||
# https://dev.azure.com/<organization>/_apis/securitynamespaces?api-version=5.0 | ||
[flags()] Enum AzDGitRepositoryPermissions | ||
{ | ||
Administer = 1 | ||
GenericRead = 2 | ||
GenericContribute = 4 | ||
ForcePush = 8 | ||
CreateBranch = 16 | ||
CreateTag = 32 | ||
ManageNote = 64 | ||
PolicyExempt = 128 | ||
CreateRepository = 256 | ||
DeleteRepository = 512 | ||
RenameRepository = 1024 | ||
EditPolicies = 2048 | ||
RemoveOthersLocks = 4096 | ||
ManagePermissions = 8192 | ||
PullRequestContribute = 16384 | ||
PullRequestBypassPolicy = 32768 | ||
} |
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,50 @@ | ||
using namespace Microsoft.PowerShell.SHiPS | ||
|
||
[SHiPSProvider(UseCache = $true)] | ||
[SHiPSProvider(BuiltinProgress = $false)] | ||
class VSTeamGroup : VSTeamLeaf { | ||
|
||
[string]$SubjectKind = $null | ||
[string]$Description = $null | ||
[string]$Domain = $null | ||
[string]$PrincipalName = $null | ||
[string]$MailAddress = $null | ||
[string]$Origin = $null | ||
[string]$OriginID = $null | ||
[string]$DisplayName = $null | ||
[string]$URL = $null | ||
[string]$Descriptor = $null | ||
[hashtable]$Links = $null | ||
|
||
VSTeamGroup ( | ||
[object]$obj | ||
) : base($obj.displayName, $obj.descriptor, $null) { | ||
$this.SubjectKind = $obj.subjectKind | ||
$this.Description = $obj.description | ||
$this.Domain = $obj.domain | ||
$this.PrincipalName = $obj.principalName | ||
$this.MailAddress = $obj.mailAddress | ||
$this.Origin = $obj.origin | ||
$this.OriginID = $obj.originId | ||
$this.DisplayName = $obj.displayName | ||
$this.ProjectName = $obj.principalName.Split('\')[0].Trim('[',']') | ||
|
||
$this.Links = @{ | ||
'Self' = $obj._links.self.href; | ||
'Memberships' = $obj._links.memberships.href; | ||
'MembershipState'= $obj._links.membershipState.href; | ||
'StorageKey'= $obj._links.storageKey.href; | ||
} | ||
|
||
$this.URL = $obj.url | ||
$this.Descriptor = $obj.descriptor | ||
|
||
$this._internalObj = $obj | ||
|
||
$this.AddTypeName('Team.Group') | ||
} | ||
|
||
[string]ToString() { | ||
return $this.PrincipalName | ||
} | ||
} |
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,10 @@ | ||
# https://dev.azure.com/<organization>/_apis/securitynamespaces?api-version=5.0 | ||
[flags()] Enum AzDIdentityPermissions | ||
{ | ||
Read = 1 | ||
Write = 2 | ||
Delete = 4 | ||
ManageMembership = 8 | ||
CreateScope = 16 | ||
RestoreScope = 32 | ||
} |
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,28 @@ | ||
# https://dev.azure.com/<organization>/_apis/securitynamespaces?api-version=5.0 | ||
[flags()] Enum AzDProjectPermissions | ||
{ | ||
GENERIC_READ = 1 | ||
GENERIC_WRITE = 2 | ||
DELETE = 4 | ||
PUBLISH_TEST_RESULTS = 8 | ||
ADMINISTER_BUILD = 16 | ||
START_BUILD = 32 | ||
EDIT_BUILD_STATUS = 64 | ||
UPDATE_BUILD = 128 | ||
DELETE_TEST_RESULTS = 256 | ||
VIEW_TEST_RESULTS = 512 | ||
MANAGE_TEST_ENVIRONMENTS = 2048 | ||
MANAGE_TEST_CONFIGURATIONS = 4096 | ||
WORK_ITEM_DELETE = 8192 | ||
WORK_ITEM_MOVE = 16384 | ||
WORK_ITEM_PERMANENTLY_DELETE = 32768 | ||
RENAME = 65536 | ||
MANAGE_PROPERTIES = 131072 | ||
MANAGE_SYSTEM_PROPERTIES = 262144 | ||
BYPASS_PROPERTY_CACHE = 524288 | ||
BYPASS_RULES = 1048576 | ||
SUPPRESS_NOTIFICATIONS = 2097152 | ||
UPDATE_VISIBILITY = 4194304 | ||
CHANGE_PROCESS = 8388608 | ||
AGILETOOLS_BACKLOG = 16777216 | ||
} |
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,12 @@ | ||
# https://dev.azure.com/<organization>/_apis/securitynamespaces?api-version=5.0 | ||
[flags()] Enum AzDWorkItemAreaPermissions | ||
{ | ||
GENERIC_READ = 1 | ||
GENERIC_WRITE = 2 | ||
CREATE_CHILDREN = 4 | ||
DELETE = 8 | ||
WORK_ITEM_READ = 16 | ||
WORK_ITEM_WRITE = 32 | ||
MANAGE_TEST_PLANS = 64 | ||
MANAGE_TEST_SUITES = 128 | ||
} |
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,8 @@ | ||
# https://dev.azure.com/<organization>/_apis/securitynamespaces?api-version=5.0 | ||
[flags()] Enum AzDWorkItemIterationPermissions | ||
{ | ||
GENERIC_READ = 1 | ||
GENERIC_WRITE = 2 | ||
CREATE_CHILDREN = 4 | ||
DELETE = 8 | ||
} |
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
Oops, something went wrong.