Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions to get/edit code policies #37

Merged
merged 4 commits into from
Feb 25, 2018
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
101 changes: 101 additions & 0 deletions .docs/Add-VSTeamPolicy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#include "./common/header.md"

# Add-VSTeamPolicy

## SYNOPSIS
#include "./synopsis/Add-VSTeamPolicy.md"

## SYNTAX

### To a project (Default)
```
Add-VSTeamPolicy -ProjectName <String> -type [guid] [-enabled] [-blocking] -settings [hashtable]
```

## DESCRIPTION
#include "./synopsis/Add-VSTeamPolicy.md"

## EXAMPLES

### -------------------------- EXAMPLE 1 --------------------------
```
PS C:\> Add-VSTeamPolicy -ProjectName Demo -type 687c53f8-1a82-4e89-9a86-13d51bc4a8d5 -enabled -blocking -settings @{MinimumApproverCount = 1;Scope=@(@{repositoryId=b87c5af8-1a82-4e59-9a86-13d5cbc4a8d5; matchKind="Exact"; refName="refs/heads/master"})}
```

This command adds a new policy to the Demo project's repository specified. The policy added requires a minimum number of reviewers and applies to the master branch. Specifying `-blocking` will block pushes to master directly.

## PARAMETERS

#include "./params/projectName.md"

### -type
Specifies the id of the type of policy to be created.

```yaml
Type: Guid
Parameter Sets: (All)

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

### -enabled
Enables the policy

```yaml
Type: Boolean
Parameter Sets: (All)

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


### -blocking
Determines if the policy will block pushes to the branch if the policy is not adheared to.

```yaml
Type: Boolean
Parameter Sets: (All)

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


### -settings
The settings for the policy.

Each policy type has it's own settings that will need to be set.

```yaml
Type: Hashtable
Parameter Sets: (All)

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

## INPUTS

## OUTPUTS

## NOTES

## RELATED LINKS

[Get-VSTeamPolicy](Get-VSTeamPolicy.md)
[Remove-VSTeamPolicy](Remove-VSTeamPolicy.md)
[Get-VSTeamPolicyType](Get-VSTeamPolicyType.md)
69 changes: 69 additions & 0 deletions .docs/Get-VSTeamPolicy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#include "./common/header.md"

# Get-VSTeamPolicy

## SYNOPSIS
#include "./synopsis/Get-VSTeamPolicy.md"

## SYNTAX

### All in project (Default)
```
Get-VSTeamPolicy -ProjectName <String>
```

### ById
```
Get-VSTeamPolicy -ProjectName <String> [-Id <Int>]
```

## DESCRIPTION
#include "./synopsis/Get-VSTeamPolicy.md"

## EXAMPLES

### -------------------------- EXAMPLE 1 --------------------------
```
PS C:\> Get-VSTeamPolicy -ProjectName Demo
```

This command returns all the policies for the Demo project in your TFS or Team Services account.

### -------------------------- EXAMPLE 3 --------------------------
```
PS C:\> Get-VSTeamPolicy -ProjectName Demo -Id 1
```

This command gets the policy with an id of 1 within the Demo project.

## PARAMETERS

#include "./params/projectName.md"

### -Id
Specifies one code policy by id.

The id is an integer. Unique within each project.

```yaml
Type: Int
Parameter Sets: ByID

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

## INPUTS

## OUTPUTS

## NOTES

## RELATED LINKS

[Add-VSTeamPolicy](Add-VSTeamPolicy.md)
[Remove-VSTeamPolicy](Remove-VSTeamPolicy.md)
[Get-VSTeamPolicyType](Get-VSTeamPolicyType.md)
67 changes: 67 additions & 0 deletions .docs/Get-VSTeamPolicyType.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#include "./common/header.md"

# Get-VSTeamPolicyType

## SYNOPSIS
#include "./synopsis/Get-VSTeamPolicyType.md"

## SYNTAX

### All in project (Default)
```
Get-VSTeamPolicyType -ProjectName <String>
```

### ById
```
Get-VSTeamPolicyType -ProjectName <String> [-Id <Guid>]
```

## DESCRIPTION
#include "./synopsis/Get-VSTeamPolicyType.md"

## EXAMPLES

### -------------------------- EXAMPLE 1 --------------------------
```
PS C:\> Get-VSTeamPolicyType -ProjectName Demo
```

This command returns all the policy types for the Demo project.

### -------------------------- EXAMPLE 3 --------------------------
```
PS C:\> Get-VSTeamPolicyType -ProjectName Demo -Id 73da726a-8ff9-44d7-8caa-cbb581eac991
```

This command gets the policy type by the specified id within the Demo project.

## PARAMETERS

#include "./params/projectName.md"

### -Id
Specifies one policy type by id.

```yaml
Type: Guid[]
Parameter Sets: ByID

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

## INPUTS

## OUTPUTS

## NOTES

## RELATED LINKS

[Add-VSTeamPolicy](Add-VSTeamPolicy.md)
[Remove-VSTeamPolicy](Remove-VSTeamPolicy.md)
[Get-VSTeamPolicy](Get-VSTeamPolicy.md)
59 changes: 59 additions & 0 deletions .docs/Remove-VSTeamPolicy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#include "./common/header.md"

# Remove-VSTeamPolicy

## SYNOPSIS
#include "./synopsis/Remove-VSTeamPolicy.md"

## SYNTAX

```
Remove-VSTeamPolicy [-ProjectName] <String> [-Id <Int[]>] [-Force]
```

## DESCRIPTION
Remove-VSTeamPolicy removes the policy from the specified project.

## EXAMPLES

### -------------------------- EXAMPLE 1 --------------------------
```
PS C:\> Remove-VSTeamPolicy -ProjectName Demo -Id 1
```

This command removes the policy with ID of 1 from the Demo project.

## PARAMETERS

#include "./params/projectName.md"

### -Id
Specifies one or more policies by ID.

To find the ID of a policy see [Get-VSTeamPolicy](Get-VSTeamPolicy.md)

```yaml
Type: Int[]
Parameter Sets: (All)
Aliases: None

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

#include "./params/force.md"

## INPUTS

## OUTPUTS

## NOTES

## RELATED LINKS

[Add-VSTeamPolicy](Add-VSTeamPolicy.md)
[Get-VSTeamPolicy](Get-VSTeamPolicy.md)
[Get-VSTeamPolicyType](Get-VSTeamPolicyType.md)
Loading