Add-VSTeamWorkItemAreaPermission
SYNOPSIS
Add Permissions to a Work Item Area
SYNTAX
ByProjectAndAreaIdAndUser (Default)
Add-VSTeamWorkItemAreaPermission -Project <Project> -AreaID <Int32> -User <User>
[-Allow <WorkItemAreaPermissions>] [-Deny <WorkItemAreaPermissions>] [-OverwriteMask] [<CommonParameters>]
ByProjectAndAreaIdAndGroup
Add-VSTeamWorkItemAreaPermission -Project <Project> -AreaID <Int32> -Group <Group>
[-Allow <WorkItemAreaPermissions>] [-Deny <WorkItemAreaPermissions>] [-OverwriteMask] [<CommonParameters>]
ByProjectAndAreaIdAndDescriptor
Add-VSTeamWorkItemAreaPermission -Project <Project> -AreaID <Int32> -Descriptor <String>
[-Allow <WorkItemAreaPermissions>] [-Deny <WorkItemAreaPermissions>] [-OverwriteMask] [<CommonParameters>]
ByProjectAndAreaPathAndGroup
Add-VSTeamWorkItemAreaPermission -Project <Project> -AreaPath <String> -Group <Group>
[-Allow <WorkItemAreaPermissions>] [-Deny <WorkItemAreaPermissions>] [-OverwriteMask] [<CommonParameters>]
ByProjectAndAreaPathAndUser
Add-VSTeamWorkItemAreaPermission -Project <Project> -AreaPath <String> -User <User>
[-Allow <WorkItemAreaPermissions>] [-Deny <WorkItemAreaPermissions>] [-OverwriteMask] [<CommonParameters>]
ByProjectAndAreaPathAndDescriptor
Add-VSTeamWorkItemAreaPermission -Project <Project> -AreaPath <String> -Descriptor <String>
[-Allow <WorkItemAreaPermissions>] [-Deny <WorkItemAreaPermissions>] [-OverwriteMask] [<CommonParameters>]
DESCRIPTION
Add Permissions to a Work Item Area
EXAMPLES
Example 1
Add-VSTeamWorkItemAreaPermission -AreaID 201 -AreaPath "Features\Authentication" -Descriptor "vssgp.User1D3nt1f13r" -User "vssa.User1D3nt1f13r" -Group "vssgp.Group1D3nt1f13r" -Allow "Read,Write" -Deny "Delete" -ProjectName "WebAppProject"
This command adds read and write permissions to the work item area with ID 201 and path "Features\Authentication" for a user with the descriptor "vssa.User1D3nt1f13r" and a group with the descriptor "vssgp.Group1D3nt1f13r" in the "WebAppProject". It denies the delete permission for the same.
Example 2
Add-VSTeamWorkItemAreaPermission -AreaID 202 -AreaPath "Features\Registration" -Descriptor "vssgp.User2D3nt1f13r" -User "vssa.User2D3nt1f13r" -Group "vssgp.Group2D3nt1f13r" -Allow "Read" -ProjectName "WebAppProject"
This example grants read permission to the work item area with ID 202 and path "Features\Registration" for a user with the descriptor "vssa.User2D3nt1f13r" and a group with the descriptor "vssgp.Group2D3nt1f13r" in the "WebAppProject".
Example 3
Add-VSTeamWorkItemAreaPermission -AreaID 203 -AreaPath "Features\Payments" -Descriptor "vssgp.User3D3nt1f13r" -User "vssa.User3D3nt1f13r" -Group "vssgp.Group3D3nt1f13r" -Allow "Read,Write,Delete" -ProjectName "WebAppProject" -OverwriteMask
In this command, permissions for the work item area with ID 203 and path "Features\Payments" are set for a user with the descriptor "vssa.User3D3nt1f13r" and a group with the descriptor "vssgp.Group3D3nt1f13r" in the "WebAppProject". The permissions are read, write, and delete. The `-OverwriteMask` switch indicates that these permissions will overwrite any existing permissions.
Example 4
$permissions = @{
AreaID = 204
AreaPath = "Features\Reporting"
Descriptor = "vssgp.User4D3nt1f13r"
User = "vssa.User4D3nt1f13r"
Group = "vssgp.Group4D3nt1f13r"
Allow = "Read"
ProjectName = "WebAppProject"
}
Add-VSTeamWorkItemAreaPermission @permissions
This example uses a hashtable to define the permissions and then splats those values to the `Add-VSTeamWorkItemAreaPermission` command. The command grants read permission to the work item area with ID 204 and path "Features\Reporting" for a user with the descriptor "vssa.User4D3nt1f13r" and a group with the descriptor "vssgp.Group4D3nt1f13r" in the "WebAppProject".
Example 5
Add-VSTeamWorkItemAreaPermission -AreaID 205 -AreaPath "Features\Analytics" -Descriptor "vssgp.User5D3nt1f13r" -User "vssa.User5D3nt1f13r" -Group "vssgp.Group5D3nt1f13r" -Allow "Read,Write" -Deny "Delete" -ProjectName "WebAppProject" -Confirm
This command prompts for confirmation before adding read and write permissions and denying delete permission to the work item area with ID 205 and path "Features\Analytics" for a user with the descriptor "vssa.User5D3nt1f13r" and a group with the descriptor "vssgp.Group5D3nt1f13r" in the "WebAppProject".
PARAMETERS
-AreaID
@{Text=}
Type: Int32
Parameter Sets: ByProjectAndAreaIdAndUser, ByProjectAndAreaIdAndGroup, ByProjectAndAreaIdAndDescriptor
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-AreaPath
@{Text=}
Type: String
Parameter Sets: ByProjectAndAreaPathAndGroup, ByProjectAndAreaPathAndUser, ByProjectAndAreaPathAndDescriptor
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Descriptor
@{Text=}
Type: String
Parameter Sets: ByProjectAndAreaIdAndDescriptor, ByProjectAndAreaPathAndDescriptor
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-User
@{Text=}
Type: User
Parameter Sets: ByProjectAndAreaIdAndUser, ByProjectAndAreaPathAndUser
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Group
@{Text=}
Type: Group
Parameter Sets: ByProjectAndAreaIdAndGroup, ByProjectAndAreaPathAndGroup
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Allow
@{Text=}
Type: WorkItemAreaPermissions
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Deny
@{Text=}
Type: WorkItemAreaPermissions
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-OverwriteMask
Switch to overwrite the mask values rather than merge them.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Project
{{ Fill Project Description }}
Type: Project
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
System.Object
NOTES
Prerequisites:
Set the account and version that all calls will use with Set-VSTeamAccount. Default version sets to API version 3.0 (TFS2017) if not manually set.
tips:
- check called version of the API with Get-VSTeamAPIVersion or Get-VSTeamInfo
- use Set-VSTeamDefaultProject to set default project for every call
- use Set-VSTeamDefaultAPITimeout to change the default timeout of 60 seconds for all calls.
- use Profiles to load an account and the correct version