Skip to content

Commit 33e8b14

Browse files
Enhance Help Documentation Validation for Cmdlets (#548)
* build: added mechanisms to check for examples and parameters in docs * docs: updated the contrtibution part * docs: updated cmdlet documentation with parameters * docs: updated cmdlet documentation with examples * feat: set to version 7.15.1
1 parent 3dab2aa commit 33e8b14

File tree

95 files changed

+1876
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1876
-112
lines changed

.docs/Add-VSTeamAccessControlEntry.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,48 @@
1414

1515
## EXAMPLES
1616

17+
### Example 1
18+
19+
```powershell
20+
Add-VSTeamAccessControlEntry -SecurityNamespaceId "2bf24a2b-70ba-43d3-ad97-3d9e1f75622f" -Token "MySecurityToken" -AllowMask 15 -DenyMask 2 -ProjectName "MyProject"
21+
```
22+
23+
This command adds an Access Control Entry (ACE) for the provided token in the project named "MyProject" using the specified security namespace identifier. The ACE has an allow mask of 15 and a deny mask of 2.
24+
25+
### Example 2
26+
27+
```powershell
28+
Add-VSTeamAccessControlEntry -SecurityNamespace "vsteam_lib.SecurityNamespace" -Token "MySecurityToken" -AllowMask 7 -DenyMask 0 -OverwriteMask -ProjectName "MyProject"
29+
```
30+
31+
This example adds an ACE using a `vsteam_lib.SecurityNamespace` object instead of a security namespace identifier. The allow mask is set to 7, and the deny mask is set to 0. The `-OverwriteMask` switch is used, which means the mask values will be overwritten rather than merged.
32+
33+
### Example 3
34+
35+
```powershell
36+
$aceParams = @{
37+
SecurityNamespaceId = "2bf24a2b-70ba-43d3-ad97-3d9e1f75622f";
38+
Token = "MySecurityToken";
39+
AllowMask = 31;
40+
DenyMask = 8;
41+
ProjectName = "MyProject";
42+
}
43+
Add-VSTeamAccessControlEntry @aceParams
44+
```
45+
46+
This example uses a hashtable to define the parameters for the `Add-VSTeamAccessControlEntry` cmdlet. The ACE is added with an allow mask of 31 and a deny mask of 8 for the provided token in the project "MyProject".
47+
48+
### Example 4
49+
50+
```powershell
51+
$namespace = Get-VSTeamSecurityNamespace -Name "VersionControlItems"
52+
Add-VSTeamAccessControlEntry -SecurityNamespace $namespace -Token "MyToken" -AllowMask 3 -DenyMask 1 -ProjectName "MyProject"
53+
```
54+
55+
This example first retrieves the security namespace object for "VersionControlItems" and then uses this object to add an ACE. The ACE is added with an allow mask of 3 and a deny mask of 1 for the token "MyToken" in the project "MyProject".
56+
57+
Remember, managing permissions and access control entries in a DevOps environment is a crucial task, ensuring that users and services have the appropriate permissions for their roles and responsibilities. Always be careful when modifying permissions to avoid unintentionally giving or restricting access to critical resources.
58+
1759
## PARAMETERS
1860

1961
### SecurityNamespace
@@ -123,6 +165,15 @@ Parameter Sets: ByNamespaceId
123165
Required: True
124166
```
125167
168+
### Descriptor
169+
170+
Descriptor of the token to be added.
171+
172+
```yaml
173+
Type: String
174+
Required: True
175+
```
176+
126177
### Token
127178
128179
The security Token
@@ -151,7 +202,7 @@ Required: True
151202
```
152203
### OverwriteMask
153204
154-
Switch to overwrite the mask values rather than merge them.
205+
Switch to overwrite the mask values rather than merge them.
155206
156207
```yaml
157208
Type: Switch

.docs/Add-VSTeamAzureRMServiceEndpoint.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,48 @@ The cmdlet adds a new connection between TFS/AzD and Azure using the Azure Resou
1414

1515
## EXAMPLES
1616

17+
### Example 1
18+
19+
```powershell
20+
Add-VSTeamAzureRMServiceEndpoint -SubscriptionName "MyAzureSubscription" -SubscriptionId "1234abcd-5678-efgh-9012-ijklmn345678" -SubscriptionTenantId "abcd1234-efgh-5678-ijkl-9012mn345678" -ServicePrincipalId "efgh1234-5678-abcd-9012-ijklmn345678" -ServicePrincipalKey "my-service-principal-key" -EndpointName "MyAzureEndpoint" -ProjectName "MyProject"
21+
```
22+
23+
This command adds a new Azure Resource Manager service endpoint in the project named "MyProject" using the provided Azure subscription name, subscription ID, tenant ID, service principal ID, and service principal key. The service endpoint will be named "MyAzureEndpoint".
24+
25+
### Example 2
26+
27+
```powershell
28+
$params = @{
29+
SubscriptionName = "MyAzureSubscription";
30+
SubscriptionId = "1234abcd-5678-efgh-9012-ijklmn345678";
31+
SubscriptionTenantId = "abcd1234-efgh-5678-ijkl-9012mn345678";
32+
ServicePrincipalId = "efgh1234-5678-abcd-9012-ijklmn345678";
33+
ServicePrincipalKey = "my-service-principal-key";
34+
EndpointName = "MyAzureEndpoint";
35+
ProjectName = "MyProject";
36+
}
37+
Add-VSTeamAzureRMServiceEndpoint @params
38+
```
39+
40+
This example does the same as the previous one but uses a hashtable to define the parameters for the `Add-VSTeamAzureRMServiceEndpoint` cmdlet.
41+
42+
### Example 3
43+
44+
```powershell
45+
$endpoint = @{
46+
SubscriptionName = "MyAzureSubscription";
47+
SubscriptionId = "1234abcd-5678-efgh-9012-ijklmn345678";
48+
SubscriptionTenantId = "abcd1234-efgh-5678-ijkl-9012mn345678";
49+
ServicePrincipalId = "efgh1234-5678-abcd-9012-ijklmn345678";
50+
ServicePrincipalKey = "my-service-principal-key";
51+
}
52+
Add-VSTeamAzureRMServiceEndpoint @endpoint -EndpointName "MyAzureEndpoint" -ProjectName "MyProject"
53+
```
54+
55+
This example demonstrates how you can separate the Azure-related parameters and the Azure DevOps-related parameters. The Azure parameters are stored in the `$endpoint` hashtable, and the Azure DevOps parameters are provided directly to the cmdlet.
56+
57+
Remember that when working with Azure, Service Principals are a way to give applications permissions in Azure Active Directory. This allows those applications to manage resources in Azure. The Service Principal ID and Key are used to authenticate and authorize the application. Always handle the Service Principal Key with care as it is a sensitive piece of information.
58+
1759
## PARAMETERS
1860

1961
### SubscriptionName
@@ -82,6 +124,14 @@ Type: String
82124
Position: 4
83125
```
84126
127+
### Description
128+
129+
Description of the service endpoint.
130+
131+
```yaml
132+
Type: String
133+
```
134+
85135
<!-- #include "./params/projectName.md" -->
86136
87137
## INPUTS

.docs/Add-VSTeamBanner.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
### Example 1
1818

1919
```powershell
20-
Add-VSTeamBanner -Level info -Message 'Test Message' -ExpirationDate '2024-01-01T04:00' -BannerId '9547ed55-66e1-403d-95aa-9e628726861c'
20+
Add-VSTeamBanner -Level info -Message 'Test Message' -ExpirationDate '2024-01-01T04:00' -Id '9547ed55-66e1-403d-95aa-9e628726861c'
2121
```
2222

2323
## PARAMETERS
@@ -53,7 +53,7 @@ Type: String
5353
Required: True
5454
```
5555

56-
### BannerId
56+
### Id
5757

5858
The unique identifier for the banner.
5959

.docs/Add-VSTeamBuild.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ Which source branch to use for this build. Overrides default branch in build def
9898
Type: String
9999
```
100100
101+
### TemplateParameters
102+
103+
Allows the user to pass in dynamic values to the build pipeline when queuing a new build, potentially influencing how the build runs based on the values of these parameters.
104+
101105
### BuildParameters
102106
103107
A hashtable with build parameters.

.docs/Add-VSTeamBuildPermission.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ Allows the user 'test@testuser.com' to the build with ID 5 to destry builds and
4747

4848
## PARAMETERS
4949

50+
### ProjectID
51+
52+
ID of the project.
53+
5054
### BuildID
5155

5256
The build ID of the build pipeline to permit the identity object to.

.docs/Add-VSTeamBuildTag.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,58 @@ Adds a tag to a build.
1414

1515
## EXAMPLES
1616

17+
### Example 1
18+
19+
```powershell
20+
Add-VSTeamBuildTag -Id 12345 -Tags "QA_Passed" -ProjectName "MyProject"
21+
```
22+
23+
This command adds the tag "QA_Passed" to the build with ID 12345 in the project named "MyProject".
24+
25+
### Example 2
26+
27+
```powershell
28+
$builds = Get-VSTeamBuild -ProjectName "MyProject" -Result Succeeded
29+
$builds | Add-VSTeamBuildTag -Tags "ProductionReady"
30+
```
31+
32+
This example first retrieves all builds in the "MyProject" project that have succeeded. It then adds the tag "ProductionReady" to each of these builds.
33+
34+
### Example 3
35+
36+
```powershell
37+
Add-VSTeamBuildTag -Id 67890,12345 -Tags "Reviewed,ReadyForDeploy" -ProjectName "MyProject"
38+
```
39+
40+
This command adds the tags "Reviewed" and "ReadyForDeploy" to the builds with IDs 67890 and 12345 in the project named "MyProject".
41+
42+
### Example 4
43+
44+
```powershell
45+
$tags = "Version2.0", "ReleaseCandidate"
46+
Add-VSTeamBuildTag -Id 98765 -Tags $tags -ProjectName "MyProject"
47+
```
48+
49+
This example adds the tags "Version2.0" and "ReleaseCandidate" to the build with ID 98765 in the project named "MyProject".
50+
51+
### Example 5
52+
53+
```powershell
54+
Add-VSTeamBuildTag -Id 11223 -Tags "RegressionTested" -ProjectName "MyProject" -Confirm
55+
```
56+
57+
This command adds the tag "RegressionTested" to the build with ID 11223 in the project named "MyProject". It will prompt for confirmation before adding the tag.
58+
59+
### Example 6
60+
61+
```powershell
62+
$buildId = 44556
63+
$myTags = "UI_Passed", "Backend_Tested"
64+
Add-VSTeamBuildTag -Id $buildId -Tags $myTags -ProjectName "MyProject" -Force
65+
```
66+
67+
This example adds the tags "UI_Passed" and "Backend_Tested" to the build with ID 44556 in the project named "MyProject". The `-Force` parameter ensures the tags are added without any confirmation prompt.
68+
1769
## PARAMETERS
1870

1971
<!-- #include "./params/buildIds.md" -->

.docs/Add-VSTeamExtension.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,56 @@
1414

1515
## EXAMPLES
1616

17+
### Example 1
18+
19+
```powershell
20+
Add-VSTeamExtension -PublisherId "MyPublisher" -ExtensionId "MyExtension"
21+
```
22+
23+
This command installs the specified extension "MyExtension" from the publisher "MyPublisher" into the account/project collection.
24+
25+
### Example 2
26+
27+
```powershell
28+
Add-VSTeamExtension -PublisherId "AnotherPublisher" -ExtensionId "AnotherExtension" -Version "1.2.3"
29+
```
30+
31+
This command installs version "1.2.3" of the extension "AnotherExtension" from the publisher "AnotherPublisher" into the account/project collection.
32+
33+
### Example 3
34+
35+
```powershell
36+
$myExtensionDetails = @{
37+
PublisherId = "SamplePublisher";
38+
ExtensionId = "SampleExtension";
39+
Version = "2.0.0";
40+
}
41+
42+
Add-VSTeamExtension @myExtensionDetails
43+
```
44+
45+
This example uses a hashtable to specify the details of the extension and installs version "2.0.0" of the extension "SampleExtension" from the publisher "SamplePublisher" into the account/project collection.
46+
47+
### Example 4
48+
49+
```powershell
50+
$extensions = Import-Csv -Path "C:\path\to\extensions.csv"
51+
52+
foreach ($ext in $extensions) {
53+
Add-VSTeamExtension -PublisherId $ext.PublisherId -ExtensionId $ext.ExtensionId -Version $ext.Version
54+
}
55+
```
56+
57+
This example reads a CSV file containing a list of extensions with their PublisherId, ExtensionId, and Version, and installs each extension into the account/project collection.
58+
59+
### Example 5
60+
61+
```powershell
62+
Add-VSTeamExtension -PublisherId "DevOpsTools" -ExtensionId "CI_CD_Tool"
63+
```
64+
65+
This command installs the specified extension "CI_CD_Tool" from the publisher "DevOpsTools" into the account/project collection. If there are multiple versions available, the latest version will be installed by default.
66+
1767
## PARAMETERS
1868

1969
### PublisherId

.docs/Add-VSTeamGitRepositoryPermission.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,52 @@
1414

1515
## EXAMPLES
1616

17+
### Example 1
18+
19+
```powershell
20+
$descriptorUser = "vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzM4Mzc4Njg5LTE5MzM0NTM5NjYtMzQ3NzU4NjI4OS0yNTA2ODc2NTA5LTAuMA"
21+
$descriptorGroup = "vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzM4Mzc4Njg5LTE5MzM0NTM5NjYtMzQ3NzU4NjI4OS0yNTA2ODc2NTA5LTAuMQ"
22+
Add-VSTeamGitRepositoryPermission -RepositoryId "1a2b3c4d" -RepositoryName "MyRepo" -BranchName "main" -Descriptor $descriptorUser -User $descriptorUser -Group $descriptorGroup -Allow "Read,Contribute" -Deny "Delete" -ProjectName "WebAppProject"
23+
```
24+
25+
This command adds read and contribute permissions to the "main" branch of the "MyRepo" repository for the specified user and group while denying the delete permission. The user and group are specified using their respective descriptors.
26+
27+
### Example 2
28+
29+
```powershell
30+
$descriptorUser = "vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzM4Mzc4Njg5LTE5MzM0NTM5NjYtMzQ3NzU4NjI4OS0yNTA2ODc2NTA5LTAuMA"
31+
Add-VSTeamGitRepositoryPermission -RepositoryId "2b3c4d5e" -RepositoryName "AnotherRepo" -BranchName "dev" -Descriptor $descriptorUser -User $descriptorUser -Allow "Read" -ProjectName "BackendServices"
32+
```
33+
34+
Here, read permission is granted to the "dev" branch of the "AnotherRepo" repository for the specified user using the user descriptor.
35+
36+
### Example 3
37+
38+
```powershell
39+
$descriptorGroup = "vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzM4Mzc4Njg5LTE5MzM0NTM5NjYtMzQ3NzU4NjI4OS0yNTA2ODc2NTA5LTAuMQ"
40+
Add-VSTeamGitRepositoryPermission -RepositoryId "3c4d5e6f" -RepositoryName "ThirdRepo" -BranchName "feature" -Descriptor $descriptorGroup -Group $descriptorGroup -Allow "Read,Contribute,Manage" -ProjectName "DataAnalytics"
41+
```
42+
43+
In this example, read, contribute, and manage permissions are granted to the "feature" branch of the "ThirdRepo" repository for the specified group using the group descriptor.
44+
45+
### Example 4
46+
47+
```powershell
48+
$descriptorUser = "vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzM4Mzc4Njg5LTE5MzM0NTM5NjYtMzQ3NzU4NjI4OS0yNTA2ODc2NTA5LTAuMA"
49+
Add-VSTeamGitRepositoryPermission -RepositoryId "4d5e6f7g" -RepositoryName "FourthRepo" -BranchName "hotfix" -Descriptor $descriptorUser -User $descriptorUser -Allow "Read" -Deny "Contribute,Delete" -ProjectName "MobileApp"
50+
```
51+
52+
This command grants read permission and denies contribute and delete permissions to the "hotfix" branch of the "FourthRepo" repository for the specified user using the user descriptor.
53+
54+
### Example 5
55+
56+
```powershell
57+
$descriptorGroup = "vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzM4Mzc4Njg5LTE5MzM0NTM5NjYtMzQ3NzU4NjI4OS0yNTA2ODc2NTA5LTAuMQ"
58+
Add-VSTeamGitRepositoryPermission -RepositoryId "5e6f7g8h" -RepositoryName "FifthRepo" -BranchName "release" -Descriptor $descriptorGroup -Group $descriptorGroup -Allow "Read,Contribute" -ProjectName "FrontendUI"
59+
```
60+
61+
This example grants read and contribute permissions to the "release" branch of the "FifthRepo" repository for the specified group using the group descriptor.
62+
1763
## PARAMETERS
1864

1965
### RepositoryId

.docs/Add-VSTeamKubernetesEndpoint.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,51 @@ This is only used when using the Kubernetes tasks.
1616

1717
## EXAMPLES
1818

19+
### Example 1
20+
21+
```powershell
22+
$kubeconfig = Get-Content -Path "C:\path\to\kubeconfig.json" -Raw
23+
Add-VSTeamKubernetesEndpoint -Kubeconfig $kubeconfig -KubernetesUrl "https://k8s-cluster.example.com:6443" -EndpointName "MyK8sCluster" -ClientCertificateData "CERTIFICATE_DATA" -ClientKeyData "KEY_DATA" -AcceptUntrustedCerts -GeneratePfx -ProjectName "WebAppProject"
24+
```
25+
26+
This command creates a new connection to a Kubernetes cluster using the provided kubeconfig file and details. The connection is named "MyK8sCluster" and is associated with the "WebAppProject". It accepts untrusted certificates and generates a pfx file.
27+
28+
### Example 2
29+
30+
```powershell
31+
$kubeconfig = Get-Content -Path "C:\path\to\another\kubeconfig.json" -Raw
32+
Add-VSTeamKubernetesEndpoint -Kubeconfig $kubeconfig -KubernetesUrl "https://another-k8s-cluster.example.org:6443" -EndpointName "AnotherK8sCluster" -ClientCertificateData "ANOTHER_CERTIFICATE_DATA" -ClientKeyData "ANOTHER_KEY_DATA" -ProjectName "BackendServices"
33+
```
34+
35+
Here, a new Kubernetes connection named "AnotherK8sCluster" is created for the "BackendServices" project using the provided kubeconfig file and details.
36+
37+
### Example 3
38+
39+
```powershell
40+
$kubeconfig = Get-Content -Path "C:\path\to\third\kubeconfig.json" -Raw
41+
Add-VSTeamKubernetesEndpoint -Kubeconfig $kubeconfig -KubernetesUrl "https://third-k8s-cluster.example.net:6443" -EndpointName "ThirdK8sCluster" -ClientCertificateData "THIRD_CERTIFICATE_DATA" -ClientKeyData "THIRD_KEY_DATA" -GeneratePfx -ProjectName "DataAnalytics"
42+
```
43+
44+
In this example, a connection to a third Kubernetes cluster is created with the name "ThirdK8sCluster" for the "DataAnalytics" project. It uses the provided kubeconfig file and details and generates a pfx file.
45+
46+
### Example 4
47+
48+
```powershell
49+
$kubeconfig = Get-Content -Path "C:\path\to\fourth\kubeconfig.yaml" -Raw
50+
Add-VSTeamKubernetesEndpoint -Kubeconfig $kubeconfig -KubernetesUrl "https://fourth-k8s-cluster.example.io:6443" -EndpointName "FourthK8sCluster" -ClientCertificateData "FOURTH_CERTIFICATE_DATA" -ClientKeyData "FOURTH_KEY_DATA" -AcceptUntrustedCerts -ProjectName "MobileApp"
51+
```
52+
53+
This command creates a new Kubernetes connection named "FourthK8sCluster" for the "MobileApp" project. It uses the provided kubeconfig file, details, and accepts untrusted certificates.
54+
55+
### Example 5
56+
57+
```powershell
58+
$kubeconfig = Get-Content -Path "C:\path\to\fifth\kubeconfig.yaml" -Raw
59+
Add-VSTeamKubernetesEndpoint -Kubeconfig $kubeconfig -KubernetesUrl "https://fifth-k8s-cluster.example.co:6443" -EndpointName "FifthK8sCluster" -ClientCertificateData "FIFTH_CERTIFICATE_DATA" -ClientKeyData "FIFTH_KEY_DATA" -ProjectName "FrontendUI"
60+
```
61+
62+
This example demonstrates the creation of a new Kubernetes connection named "FifthK8sCluster" for the "FrontendUI" project using the provided kubeconfig file and details.
63+
1964
## PARAMETERS
2065

2166
### Kubeconfig

0 commit comments

Comments
 (0)