Skip to main content

Add-VSTeamWorkItemIterationPermission

SYNOPSIS

Add Permissions to an Iteration

SYNTAX

ByProjectAndIterationIdAndUser (Default)

Add-VSTeamWorkItemIterationPermission -Project <Project> -IterationID <Int32> -User <User>
[-Allow <WorkItemIterationPermissions>] [-Deny <WorkItemIterationPermissions>] [-OverwriteMask]
[<CommonParameters>]

ByProjectAndIterationIdAndGroup

Add-VSTeamWorkItemIterationPermission -Project <Project> -IterationID <Int32> -Group <Group>
[-Allow <WorkItemIterationPermissions>] [-Deny <WorkItemIterationPermissions>] [-OverwriteMask]
[<CommonParameters>]

ByProjectAndIterationIdAndDescriptor

Add-VSTeamWorkItemIterationPermission -Project <Project> -IterationID <Int32> -Descriptor <String>
[-Allow <WorkItemIterationPermissions>] [-Deny <WorkItemIterationPermissions>] [-OverwriteMask]
[<CommonParameters>]

ByProjectAndIterationPathAndGroup

Add-VSTeamWorkItemIterationPermission -Project <Project> -IterationPath <String> -Group <Group>
[-Allow <WorkItemIterationPermissions>] [-Deny <WorkItemIterationPermissions>] [-OverwriteMask]
[<CommonParameters>]

ByProjectAndIterationPathAndUser

Add-VSTeamWorkItemIterationPermission -Project <Project> -IterationPath <String> -User <User>
[-Allow <WorkItemIterationPermissions>] [-Deny <WorkItemIterationPermissions>] [-OverwriteMask]
[<CommonParameters>]

ByProjectAndIterationPathAndDescriptor

Add-VSTeamWorkItemIterationPermission -Project <Project> -IterationPath <String> -Descriptor <String>
[-Allow <WorkItemIterationPermissions>] [-Deny <WorkItemIterationPermissions>] [-OverwriteMask]
[<CommonParameters>]

DESCRIPTION

Add Permissions to an Iteration

EXAMPLES

Example 1

Add-VSTeamWorkItemIterationPermission -IterationID 101 -IterationPath "Sprint 5" -Descriptor "vssgp.Uz3r1D3nt1f13r" -User "vssa.Uz3r1D3nt1f13rForUser" -Group "vssgp.Uz3r1D3nt1f13rForGroup" -Allow "Read,Write" -Deny "Delete" -ProjectName "MyProject"

This command adds read and write permissions to the iteration with ID 101 and path "Sprint 5" for a user with the descriptor "vssa.Uz3r1D3nt1f13rForUser" and a group with the descriptor "vssgp.Uz3r1D3nt1f13rForGroup" in the "MyProject". It denies the delete permission for the same.

Example 2

Add-VSTeamWorkItemIterationPermission -IterationID 102 -IterationPath "Sprint 6" -Descriptor "vssgp.An0th3r1D3nt1f13r" -User "vssa.An0th3r1D3nt1f13rForUser" -Group "vssgp.An0th3r1D3nt1f13rForGroup" -Allow "Read" -ProjectName "MyProject"

This example gives read permission to the iteration with ID 102 and path "Sprint 6" for a user with the descriptor "vssa.An0th3r1D3nt1f13rForUser" and a group with the descriptor "vssgp.An0th3r1D3nt1f13rForGroup" in the "MyProject".

Example 3

Add-VSTeamWorkItemIterationPermission -IterationID 103 -IterationPath "Sprint 7" -Descriptor "vssgp.Th1rd1D3nt1f13r" -User "vssa.Th1rd1D3nt1f13rForUser" -Group "vssgp.Th1rd1D3nt1f13rForGroup" -Allow "Read,Write,Delete" -ProjectName "MyProject" -OverwriteMask

In this command, permissions for the iteration with ID 103 and path "Sprint 7" are set for a user with the descriptor "vssa.Th1rd1D3nt1f13rForUser" and a group with the descriptor "vssgp.Th1rd1D3nt1f13rForGroup" in the "MyProject". The permissions are read, write, and delete. The `-OverwriteMask` switch indicates that these permissions will overwrite any existing permissions.

Example 4

$permissions = @{
IterationID = 104
IterationPath = "Sprint 8"
Descriptor = "vssgp.F0urth1D3nt1f13r"
User = "vssa.F0urth1D3nt1f13rForUser"
Group = "vssgp.F0urth1D3nt1f13rForGroup"
Allow = "Read"
ProjectName = "MyProject"
}
Add-VSTeamWorkItemIterationPermission @permissions

This example uses a hashtable to define the permissions and then splats those values to the `Add-VSTeamWorkItemIterationPermission` command. The command gives read permission to the iteration with ID 104 and path "Sprint 8" for a user with the descriptor "vssa.F0urth1D3nt1f13rForUser" and a group with the descriptor "vssgp.F0urth1D3nt1f13rForGroup" in the "MyProject".

Example 5

Add-VSTeamWorkItemIterationPermission -IterationID 105 -IterationPath "Sprint 9" -Descriptor "vssgp.F1fth1D3nt1f13r" -User "vssa.F1fth1D3nt1f13rForUser" -Group "vssgp.F1fth1D3nt1f13rForGroup" -Allow "Read,Write" -Deny "Delete" -ProjectName "MyProject" -Confirm

This command prompts for confirmation before adding read and write permissions and denying delete permission to the iteration with ID 105 and path "Sprint 9" for a user with the descriptor "vssa.F1fth1D3nt1f13rForUser" and a group with the descriptor "vssgp.F1fth1D3nt1f13rForGroup" in the "MyProject".

PARAMETERS

-IterationID

@{Text=}

Type: Int32
Parameter Sets: ByProjectAndIterationIdAndUser, ByProjectAndIterationIdAndGroup, ByProjectAndIterationIdAndDescriptor
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-IterationPath

@{Text=}

Type: String
Parameter Sets: ByProjectAndIterationPathAndGroup, ByProjectAndIterationPathAndUser, ByProjectAndIterationPathAndDescriptor
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Descriptor

@{Text=}

Type: String
Parameter Sets: ByProjectAndIterationIdAndDescriptor, ByProjectAndIterationPathAndDescriptor
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-User

@{Text=}

Type: User
Parameter Sets: ByProjectAndIterationIdAndUser, ByProjectAndIterationPathAndUser
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Group

@{Text=}

Type: Group
Parameter Sets: ByProjectAndIterationIdAndGroup, ByProjectAndIterationPathAndGroup
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Allow

@{Text=}

Type: WorkItemIterationPermissions
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Deny

@{Text=}

Type: WorkItemIterationPermissions
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