Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ All notable changes to this project will be documented in this file.

<br> -->


## [UNRELEASED]

### Summary
- _None_

### What's Changed
- feat(Get-AdoUser): Add user support (#124)
- feat(Get-AdoGroup): Add `domain` property to output (#126)
- fix(Get-AdoUserEntitlement): Correct error handling (#128)

### Breaking Changes
Expand Down
74 changes: 39 additions & 35 deletions docs/Get-AdoGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
document type: cmdlet
external help file: Azure.DevOps.PSModule-Help.xml
HelpUri: https://learn.microsoft.com/en-us/rest/api/azure/devops/graph/groups/list
Locale: en-NL
Locale: nl-NL
Module Name: Azure.DevOps.PSModule
ms.date: 01/02/2026
ms.date: 02-14-2026
PlatyPS schema version: 2024-05-01
title: Get-AdoGroup
-->
Expand All @@ -20,12 +20,18 @@ Get a single or multiple groups in an Azure DevOps organization.

## SYNTAX

### __AllParameterSets
### ListGroups (Default)

```text
Get-AdoGroup [[-CollectionUri] <string>] [[-ScopeDescriptor] <string>] [[-SubjectTypes] <string[]>]
[[-Name] <string[]>] [[-GroupDescriptor] <string>] [[-Version] <string>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```powershell
Get-AdoGroup [-CollectionUri <string>] [-ScopeDescriptor <string>] [-SubjectTypes <string[]>]
[-Name <string[]>] [-Version <string>] [<CommonParameters>]
```

### ByDescriptor

```powershell
Get-AdoGroup [-CollectionUri <string>] [-GroupDescriptor <string>] [-Version <string>]
[<CommonParameters>]
```

## ALIASES
Expand Down Expand Up @@ -58,7 +64,7 @@ $project = Get-AdoProject -Name 'my-project-1'
$projectDescriptor = (Get-AdoDescriptor -StorageKey $project.Id)

$params = @{
CollectionUri = 'https://dev.azure.com/my-org'
CollectionUri = 'https://dev.azure.com/my-org'
ScopeDescriptor = $projectDescriptor
SubjectTypes = 'vssgp'
}
Expand All @@ -74,7 +80,7 @@ Retrieves all groups in the specified project with subject types 'vssgp'.
```powershell
$params = @{
SubjectTypes = 'vssgp'
ScopeDescriptor = $prjDscr
ScopeDescriptor = $projectDescriptor
Name = @(
'Project Administrators',
'Contributors'
Expand Down Expand Up @@ -123,65 +129,63 @@ AcceptedValues: []
HelpMessage: ''
```

### -ScopeDescriptor
### -GroupDescriptor

Optional.
Specify a non-default scope (collection, project) to search for groups.
The descriptor of a specific group to retrieve. When provided, retrieves a single group by its descriptor.

```yaml
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
- Name: ByDescriptor
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipeline: true
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

### -SubjectTypes
### -Name

Optional.
A comma separated list of user subject subtypes to reduce the retrieved results, e.g. Microsoft.IdentityModel.Claims.ClaimsIdentity
A group's display name to filter the retrieved results.
Supports wildcards for pattern matching.

```yaml
Type: System.String[]
DefaultValue: ('vssgp', 'aadgp')
DefaultValue: ''
SupportsWildcards: false
Aliases: []
Aliases:
- DisplayName
- GroupName
ParameterSets:
- Name: (All)
- Name: ListGroups
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues:
- vssgp
- aadgp
AcceptedValues: []
HelpMessage: ''
```

### -Name
### -ScopeDescriptor

Optional.
A group's display name to filter the retrieved results.
Supports wildcards for pattern matching.
Specify a non-default scope (collection, project) to search for groups.

```yaml
Type: System.String[]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases:
- DisplayName
- GroupName
Aliases: []
ParameterSets:
- Name: ListGroups
Position: Named
Expand All @@ -194,22 +198,22 @@ AcceptedValues: []
HelpMessage: ''
```

### -GroupDescriptor
### -SubjectTypes

Optional.
The descriptor of a specific group to retrieve.
When provided, retrieves a single group by its descriptor.
A comma separated list of user subject subtypes to reduce the retrieved results, e.g.
Microsoft.IdentityModel.Claims.ClaimsIdentity

```yaml
Type: System.String
DefaultValue: ''
Type: System.String[]
DefaultValue: "@('vssgp', 'aadgp')"
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByDescriptor
- Name: ListGroups
Position: Named
IsRequired: false
ValueFromPipeline: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
Expand Down
18 changes: 11 additions & 7 deletions src/Azure.DevOps.PSModule/Public/Graph/Groups/Get-AdoGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
Optional. A comma separated list of user subject subtypes to reduce the retrieved results, e.g. Microsoft.IdentityModel.Claims.ClaimsIdentity

.PARAMETER Name
Optional. A group's display name to filter the retrieved results.
Optional. A group's display name to filter the retrieved results. Supports wildcards for pattern matching.

.PARAMETER GroupDescriptor
Optional. The descriptor of a specific group to retrieve. When provided, retrieves a single group by its descriptor.

.PARAMETER Version
The API version to use. Default is '7.2-preview.1'.
The API version to use for the request. Default is '7.2-preview.1'.
The -preview flag must be supplied in the api-version for this request to work.

.OUTPUTS
Expand All @@ -39,7 +42,7 @@
$projectDescriptor = (Get-AdoDescriptor -StorageKey $project.Id)

$params = @{
CollectionUri = 'https://dev.azure.com/my-org'
CollectionUri = 'https://dev.azure.com/my-org'
ScopeDescriptor = $projectDescriptor
SubjectTypes = 'vssgp'
}
Expand Down Expand Up @@ -167,13 +170,14 @@

foreach ($g_ in $groups) {
$obj = [ordered]@{
displayName = $g_.displayName
originId = $g_.originId
principalName = $g_.principalName
origin = $g_.origin
subjectKind = $g_.subjectKind
description = $g_.description
domain = $g_.domain
principalName = $g_.principalName
mailAddress = $g_.mailAddress
origin = $g_.origin
originId = $g_.originId
displayName = $g_.displayName
descriptor = $g_.descriptor
collectionUri = $CollectionUri
}
Expand Down
31 changes: 18 additions & 13 deletions src/Azure.DevOps.PSModule/Tests/Graph/Groups/Get-AdoGroup.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,26 @@ Describe 'Get-AdoGroup' {
$mockScopeDescriptor = 'scp.00000000-0000-0000-0000-000000000002'

$mockGroup1 = [PSCustomObject]@{
displayName = 'Project Administrators'
originId = '00000000-0000-0000-0000-000000000001'
principalName = '[TestProject]\Project Administrators'
origin = 'vsts'
subjectKind = 'group'
description = 'Admin group'
mailAddress = ''
domain = 'vstfs://Classification/TeamProject/00000000-0000-0000-0000-000000000001'
principalName = '[TestProject]\Project Administrators'
mailAddress = $null
origin = 'vsts'
originId = '00000000-0000-0000-0000-000000000001'
displayName = 'Project Administrators'
descriptor = 'vssgp.00000000-0000-0000-0000-000000000001'
}

$mockGroup2 = [PSCustomObject]@{
displayName = 'Contributors'
originId = '00000000-0000-0000-0000-000000000002'
principalName = '[TestProject]\Contributors'
origin = 'vsts'
subjectKind = 'group'
description = 'Contributor group'
mailAddress = ''
domain = 'vstfs://Classification/TeamProject/00000000-0000-0000-0000-000000000002'
principalName = '[TestProject]\Contributors'
mailAddress = $null
origin = 'vsts'
originId = '00000000-0000-0000-0000-000000000002'
displayName = 'Contributors'
descriptor = 'vssgp.00000000-0000-0000-0000-000000000002'
}

Expand Down Expand Up @@ -66,11 +68,14 @@ Describe 'Get-AdoGroup' {
$result = Get-AdoGroup -CollectionUri $mockCollectionUri

# Assert
$result[0].PSObject.Properties.Name | Should -Contain 'displayName'
$result[0].PSObject.Properties.Name | Should -Contain 'originId'
$result[0].PSObject.Properties.Name | Should -Contain 'subjectKind'
$result[0].PSObject.Properties.Name | Should -Contain 'description'
$result[0].PSObject.Properties.Name | Should -Contain 'domain'
$result[0].PSObject.Properties.Name | Should -Contain 'principalName'
$result[0].PSObject.Properties.Name | Should -Contain 'mailAddress'
$result[0].PSObject.Properties.Name | Should -Contain 'origin'
$result[0].PSObject.Properties.Name | Should -Contain 'subjectKind'
$result[0].PSObject.Properties.Name | Should -Contain 'originId'
$result[0].PSObject.Properties.Name | Should -Contain 'displayName'
$result[0].PSObject.Properties.Name | Should -Contain 'descriptor'
$result[0].PSObject.Properties.Name | Should -Contain 'collectionUri'
}
Expand Down