Skip to content

Commit 1b3c407

Browse files
author
SimonDeeb
committed
add descriptions and examples to cmdlets
1 parent eb87e9a commit 1b3c407

File tree

5 files changed

+160
-12
lines changed

5 files changed

+160
-12
lines changed

AzureDevOpsPowerShell/Public/Api/Core/Teams/Remove-AzDoTeam.ps1

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
11
function Remove-AzDoTeam {
2+
<#
3+
.SYNOPSIS
4+
Remove a team from Azure DevOps.
5+
.DESCRIPTION
6+
Remove a team from Azure DevOps.
7+
.EXAMPLE
8+
$params = @{
9+
CollectionUri = 'https://dev.azure.com/organization'
10+
ProjectName = 'ProjectName'
11+
TeamName = 'TeamName'
12+
}
13+
Remove-AzDoTeam @params
14+
.EXAMPLE
15+
$params = @{
16+
CollectionUri = 'https://dev.azure.com/organization'
17+
ProjectName = 'ProjectName'
18+
TeamId = 'TeamId'
19+
}
20+
Remove-AzDoTeam @params
21+
#>
222
param (
323
# Collection Uri of the organization
424
[Parameter(Mandatory)]

AzureDevOpsPowerShell/Public/Api/Work/WorkItems/Get-AzDoWorkItem.ps1

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
11
function Get-AzDoWorkItem {
2+
<#
3+
.SYNOPSIS
4+
Get a work item from Azure DevOps.
5+
.DESCRIPTION
6+
Get a work item from Azure DevOps.
7+
.EXAMPLE
8+
$params = @{
9+
CollectionUri = 'https://dev.azure.com/organization'
10+
ProjectName = 'ProjectName'
11+
WorkItemId = 1
12+
}
13+
Get-AzDoWorkItem @params
14+
.EXAMPLE
15+
$params = @{
16+
CollectionUri = 'https://dev.azure.com/organization'
17+
ProjectName = 'ProjectName'
18+
WorkItemId = 1, 2, 3
19+
}
20+
Get-AzDoWorkItem @params
21+
.OUTPUTS
22+
[PSCustomObject]@{
23+
Id = 1
24+
Title = "Test Work Item 1"
25+
AreaPath = "DevOps Automation"
26+
IterationPath = "DevOps Automation"
27+
TeamProject = "DevOps Automation"
28+
WorkItemType = "Task"
29+
State = "New"
30+
Reason = "New"
31+
AssignedTo = "John Doe"
32+
CreatedDate = "2021-01-01T00:00:00Z"
33+
CreatedBy = "John Doe"
34+
Url = "https://dev.azure.com/organization/ProjectName/_apis/wit/workitems/1"
35+
}
36+
#>
237
[CmdletBinding(SupportsShouldProcess)]
338
param (
439
# Collection Uri of the organization

AzureDevOpsPowerShell/Public/Api/Work/WorkItems/New-AzDoWorkItem.ps1

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,59 @@
11
function New-AzDoWorkItem {
2+
<#
3+
.SYNOPSIS
4+
Create a new work item in Azure DevOps.
5+
.DESCRIPTION
6+
Create a new work item in Azure DevOps.
7+
8+
.EXAMPLE
9+
$params = @{
10+
CollectionUri = 'https://dev.azure.com/organization'
11+
ProjectName = 'ProjectName'
12+
WorkItem = @{
13+
Title = "Test Work Item 1"
14+
WorkItemType = "Task"
15+
Description = "This is a test work item."
16+
AreaPath = "DevOps Automation"
17+
IterationPath = "DevOps Automation"
18+
TeamProject = "DevOps Automation"
19+
ParentId = 3
20+
}
21+
}
22+
New-AzDoWorkItem @params
23+
24+
.EXAMPLE
25+
$params = @{
26+
CollectionUri = 'https://dev.azure.com/organization'
27+
ProjectName = 'ProjectName'
28+
WorkItem = @(
29+
@{
30+
Title = "Test Work Item 1"
31+
WorkItemType = "Task"
32+
Description = "This is a test work item."
33+
AreaPath = "DevOps Automation"
34+
IterationPath = "DevOps Automation"
35+
TeamProject = "DevOps Automation"
36+
},
37+
@{
38+
Title = "Test Work Item 2"
39+
WorkItemType = "Task"
40+
Description = "This is a test work item."
41+
AreaPath = "DevOps Automation"
42+
IterationPath = "DevOps Automation"
43+
TeamProject = "DevOps Automation"
44+
ParentId = 3
45+
}
46+
)
47+
}
48+
New-AzDoWorkItem @params
49+
50+
.OUTPUTS
51+
[PSCustomObject]@{
52+
Id = 1
53+
Name = "Test Work Item 1"
54+
Url = "https://dev.azure.com/organization/ProjectName/_apis/wit/workitems/1"
55+
}
56+
#>
257
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')]
358
param (
459
# Collection Uri of the organization
@@ -12,18 +67,6 @@ function New-AzDoWorkItem {
1267
[string]
1368
$ProjectName,
1469

15-
# Work item object (could be a hashtable or a custom object)
16-
# template: @{
17-
# Title = "Test Work Item 2" (required)
18-
# WorkItemType = "Task" (required)
19-
# Description = "This is a test work item." (optional)
20-
# AreaPath = "DevOps Automation" (optional)
21-
# IterationPath = "DevOps Automation" (optional)
22-
# TeamProject = "DevOps Automation" (optional)
23-
# State = "To Do" (optional)
24-
# Reason = "Added to backlog" (optional)
25-
# ParentId = "3" (optional)
26-
# }
2770
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
2871
[object[]]
2972
$WorkItem

AzureDevOpsPowerShell/Public/Api/Work/WorkItems/Remove-AzDoWorkItem.ps1

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
11
function Remove-AzDoWorkItem {
2+
<#
3+
.SYNOPSIS
4+
Remove a work item from Azure DevOps.
5+
6+
.DESCRIPTION
7+
Remove a work item from Azure DevOps.
8+
9+
.EXAMPLE
10+
$params = @{
11+
CollectionUri = 'https://dev.azure.com/organization'
12+
ProjectName = 'ProjectName'
13+
WorkItemId = 1
14+
}
15+
Remove-AzDoWorkItem @params
16+
17+
.EXAMPLE
18+
$params = @{
19+
CollectionUri = 'https://dev.azure.com/organization'
20+
ProjectName = 'ProjectName'
21+
WorkItemId = 1, 2, 3
22+
}
23+
Remove-AzDoWorkItem @params
24+
#>
225
[CmdletBinding(SupportsShouldProcess)]
326
param (
427
# Collection Uri of the organization

AzureDevOpsPowerShell/Public/Api/Work/WorkItems/Set-AzDoWorkItem.ps1

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
11
function Set-AzDoWorkItem {
2+
<#
3+
.SYNOPSIS
4+
Set a work item in Azure DevOps.
5+
.DESCRIPTION
6+
Set a work item in Azure DevOps.
7+
.EXAMPLE
8+
$params = @{
9+
CollectionUri = 'https://dev.azure.com/organization'
10+
ProjectName = 'ProjectName'
11+
WorkItem = @{
12+
WorkItemId = 1
13+
Title = "Test Work Item 2"
14+
Description = "This is a test work item."
15+
AreaPath = "DevOps Automation"
16+
IterationPath = "DevOps Automation"
17+
TeamProject = "DevOps Automation"
18+
ParentId = 3
19+
}
20+
}
21+
Set-AzDoWorkItem @params
22+
.OUTPUTS
23+
[PSCustomObject]@{
24+
Id = 1
25+
Name = "Test Work Item 2"
26+
Url = "https://dev.azure.com/organization/ProjectName/_apis/wit/workitems/1"
27+
}
28+
#>
229
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')]
330
param (
431
# Collection Uri of the organization

0 commit comments

Comments
 (0)