|
12 | 12 | .EXAMPLE |
13 | 13 | Get-GitHubOrganization |
14 | 14 |
|
15 | | - List organizations for the authenticated user. |
| 15 | + List all organizations for the authenticated user. |
16 | 16 |
|
17 | 17 | .EXAMPLE |
18 | 18 | Get-GitHubOrganization -Username 'octocat' |
19 | 19 |
|
20 | | - List public organizations for the user 'octocat'. |
| 20 | + List public organizations for a specific user. |
21 | 21 |
|
22 | 22 | .EXAMPLE |
23 | 23 | Get-GitHubOrganization -All -Since 142951047 |
24 | 24 |
|
25 | | - List organizations, starting with PSModule. |
| 25 | + List all organizations made after an ID. |
26 | 26 |
|
27 | 27 | .EXAMPLE |
28 | 28 | Get-GitHubOrganization -Name 'PSModule' |
29 | 29 |
|
30 | | - Get the organization 'PSModule'. |
| 30 | + Get a specific organization. |
| 31 | +
|
| 32 | + .EXAMPLE |
| 33 | + Get-GitHubOrganization -Enterprise 'msx' |
| 34 | +
|
| 35 | + Get the organizations belonging to an Enterprise. |
31 | 36 |
|
32 | 37 | .OUTPUTS |
33 | 38 | GitHubOrganization |
|
36 | 41 | https://psmodule.io/GitHub/Functions/Organization/Get-GitHubOrganization |
37 | 42 | #> |
38 | 43 | [OutputType([GitHubOrganization])] |
39 | | - [CmdletBinding(DefaultParameterSetName = '__AllParameterSets')] |
| 44 | + [CmdletBinding(DefaultParameterSetName = 'List all organizations for the authenticated user')] |
40 | 45 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', 'All', Justification = 'Required for parameter set')] |
41 | 46 | param( |
42 | 47 | # The organization name. The name is not case sensitive. |
43 | 48 | [Parameter( |
44 | 49 | Mandatory, |
45 | | - ParameterSetName = 'NamedOrg', |
| 50 | + ParameterSetName = 'Get a specific organization', |
46 | 51 | ValueFromPipeline, |
47 | 52 | ValueFromPipelineByPropertyName |
48 | 53 | )] |
|
51 | 56 | # The handle for the GitHub user account. |
52 | 57 | [Parameter( |
53 | 58 | Mandatory, |
54 | | - ParameterSetName = 'NamedUser', |
| 59 | + ParameterSetName = 'List public organizations for a specific user', |
55 | 60 | ValueFromPipelineByPropertyName |
56 | 61 | )] |
57 | 62 | [Alias('User')] |
58 | 63 | [string] $Username, |
59 | 64 |
|
| 65 | + # The Enterprise slug to get organizations from. |
| 66 | + [Parameter( |
| 67 | + Mandatory, |
| 68 | + ParameterSetName = 'Get the organizations belonging to an Enterprise', |
| 69 | + ValueFromPipelineByPropertyName |
| 70 | + )] |
| 71 | + [string] $Enterprise, |
| 72 | + |
60 | 73 | # List all organizations. Use '-Since' to start at a specific organization ID. |
61 | 74 | [Parameter( |
62 | 75 | Mandatory, |
63 | | - ParameterSetName = 'AllOrg' |
| 76 | + ParameterSetName = 'List all organizations on the tenant' |
64 | 77 | )] |
65 | 78 | [switch] $All, |
66 | 79 |
|
67 | 80 | # A organization ID. Only return organizations with an ID greater than this ID. |
68 | | - [Parameter(ParameterSetName = 'AllOrg')] |
| 81 | + [Parameter(ParameterSetName = 'List all organizations on the tenant')] |
69 | 82 | [int] $Since = 0, |
70 | 83 |
|
71 | 84 | # The number of results per page (max 100). |
72 | | - [Parameter(ParameterSetName = 'AllOrg')] |
73 | | - [Parameter(ParameterSetName = 'UserOrg')] |
74 | | - [Parameter(ParameterSetName = '__AllParameterSets')] |
| 85 | + [Parameter(ParameterSetName = 'List all organizations on the tenant')] |
| 86 | + [Parameter(ParameterSetName = 'List all organizations for the authenticated user')] |
75 | 87 | [System.Nullable[int]] $PerPage, |
76 | 88 |
|
77 | 89 | # The context to run the command in. Used to get the details for the API call. |
|
89 | 101 |
|
90 | 102 | process { |
91 | 103 | switch ($PSCmdlet.ParameterSetName) { |
92 | | - 'NamedOrg' { |
| 104 | + 'Get a specific organization' { |
93 | 105 | Get-GitHubOrganizationByName -Name $Name -Context $Context |
94 | 106 | } |
95 | | - 'NamedUser' { |
| 107 | + 'List public organizations for a specific user' { |
96 | 108 | Get-GitHubUserOrganization -Username $Username -Context $Context |
97 | 109 | } |
98 | | - 'AllOrg' { |
| 110 | + 'Get the organizations belonging to an Enterprise' { |
| 111 | + Get-GitHubAppInstallableOrganization -Enterprise $Enterprise -Context $Context |
| 112 | + } |
| 113 | + 'List all organizations on the tenant' { |
99 | 114 | Get-GitHubAllOrganization -Since $Since -PerPage $PerPage -Context $Context |
100 | 115 | } |
101 | 116 | default { |
|
0 commit comments