Skip to content

Commit 190f898

Browse files
Set-ADOPermission: Adding support for -EndpointID (Fixing #137)
1 parent d71853a commit 190f898

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

Set-ADOPermission.ps1

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
# If this is provided without anything else, will get permissions for the projectID
2727
[Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='Project')]
2828
[Parameter(ValueFromPipelineByPropertyName,ParameterSetName='Analytics')]
29+
[Parameter(ValueFromPipelineByPropertyName,ParameterSetName='EndpointID')]
2930
[Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='AreaPath')]
3031
[Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='Dashboard')]
3132
[Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='IterationPath')]
@@ -97,21 +98,27 @@
9798
[switch]
9899
$Tagging,
99100

101+
100102
# If set, will set permissions for Team Foundation Version Control related to the current project.
101103
[Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='ManageTFVC')]
102104
[switch]
103105
$ManageTFVC,
104106

105-
# If set, will get permissions for Delivery Plans.
107+
# If set, will set permissions for Delivery Plans.
106108
[Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='Plan')]
107109
[switch]
108110
$Plan,
109111

110-
# If set, will get dashboard permissions related to the current project.
112+
# If set, will set dashboard permissions related to the current project.
111113
[Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='Dashboard')]
112114
[Alias('Dashboards')]
113115
[switch]
114116
$Dashboard,
117+
118+
# If set, will set endpoint permissions related to a particular endpoint.
119+
[Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='EndpointID')]
120+
[string]
121+
$EndpointID,
115122

116123
# If set, will list the type of permisssions.
117124
[Parameter(ParameterSetName='securitynamespaces')]
@@ -282,6 +289,16 @@
282289
SecurityToken = "Plan"
283290
} + $PSBoundParameters)
284291
}
292+
EndpointID {
293+
$q.Enqueue(@{
294+
NamespaceID = '49b48001-ca20-4adc-8111-5b60c903a50c'
295+
SecurityToken = "endpoints/$(
296+
if ($ProjectID) {"$ProjectID/"} else { "Collection/"}
297+
)$(
298+
if ($EndpointID) {$EndpointID}
299+
)"
300+
} + $PSBoundParameters)
301+
}
285302
Tagging {
286303
$q.Enqueue(@{
287304
NamespaceID = 'bb50f182-8e5e-40b8-bc21-e8752a1e7ae2'

0 commit comments

Comments
 (0)