Skip to content

Commit 0ee2de3

Browse files
authored
Merge pull request #54 from WeAreInSpark/docs/add-docs
docs: fixing docs
2 parents f982a64 + 30878bf commit 0ee2de3

File tree

54 files changed

+58
-5494
lines changed

Some content is hidden

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

54 files changed

+58
-5494
lines changed

AzureDevOpsPowerShell/Public/Api/Build/GeneralSettings/Set-AzDOProjectSetting.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function Set-AzDoProjectSetting {
77
.EXAMPLE
88
$params = @{
99
CollectionUri = "https://dev.azure.com/contoso"
10-
PAT = "***"
1110
ProjectName = "Project01"
1211
EnforceJobAuthScope = $true
1312
EnforceJobAuthScopeForReleases = $true

AzureDevOpsPowerShell/Public/Api/Core/Projects/Get-AzDoProject.ps1

-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function Get-AzDoProject {
77
.EXAMPLE
88
$Params = @{
99
CollectionUri = "https://dev.azure.com/contoso"
10-
PAT = "***"
1110
}
1211
Get-AzDoProject @params
1312
@@ -16,7 +15,6 @@ function Get-AzDoProject {
1615
.EXAMPLE
1716
$Params = @{
1817
CollectionUri = "https://dev.azure.com/contoso"
19-
PAT = "***"
2018
ProjectName = 'Project1'
2119
}
2220
Get-AzDoProject @params
@@ -26,7 +24,6 @@ function Get-AzDoProject {
2624
.EXAMPLE
2725
$params = @{
2826
collectionuri = "https://dev.azure.com/contoso"
29-
PAT = "***"
3027
}
3128
$somedifferentobject = [PSCustomObject]@{
3229
ProjectName = 'Project1'
@@ -38,7 +35,6 @@ function Get-AzDoProject {
3835
.EXAMPLE
3936
$params = @{
4037
collectionuri = "https://dev.azure.com/contoso"
41-
PAT = "***"
4238
}
4339
@(
4440
'Project1',

AzureDevOpsPowerShell/Public/Api/Core/Projects/Remove-AzDoProject.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ function Remove-AzDoProject {
55
.DESCRIPTION
66
Function to create an Azure DevOps project
77
.EXAMPLE
8-
New-AzDoProject -CollectionUri "https://dev.azure.com/contoso" -PAT "***" -ProjectName "Project 1"
8+
New-AzDoProject -CollectionUri "https://dev.azure.com/contoso" -ProjectName "Project 1"
99
1010
This example creates a new private Azure DevOps project
1111
.EXAMPLE
12-
New-AzDoProject -CollectionUri "https://dev.azure.com/contoso" -PAT "***" -ProjectName "Project 1" -Visibility 'public'
12+
New-AzDoProject -CollectionUri "https://dev.azure.com/contoso" -ProjectName "Project 1" -Visibility 'public'
1313
1414
This example creates a new public Azure DevOps project
1515
.EXAMPLE
16-
@("MyProject1","Myproject2") | New-AzDoProject -CollectionUri "https://dev.azure.com/contoso" -PAT "***"
16+
@("MyProject1","Myproject2") | New-AzDoProject -CollectionUri "https://dev.azure.com/contoso"
1717
1818
This example creates two new Azure DevOps projects using the pipeline.
1919

AzureDevOpsPowerShell/Public/Api/DistributedTask/VariableGroups/Add-AzDoVariableGroupVariable.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ function Add-AzDoVariableGroupVariable {
99
$splat = @{
1010
CollectionUri = 'https://dev.azure.com/ChristianPiet0452/'
1111
ProjectName = 'Ditproject'
12-
PAT = '*******************'
1312
VariableGroupName = @('Group1', 'Group2')
1413
Variables = @{
1514
test = @{

AzureDevOpsPowerShell/Public/Api/DistributedTask/VariableGroups/Get-AzDoVariableGroup.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ function Get-AzDoVariableGroup {
88
.EXAMPLE
99
$params = @{
1010
Collectionuri = 'https://dev.azure.com/weareinspark/'
11-
PAT = '*******************'
1211
ProjectName = 'Project 1'
1312
VariableGroupName = 'VariableGroup1','VariableGroup2'
1413
}

AzureDevOpsPowerShell/Public/Api/DistributedTask/VariableGroups/New-AzDoVariableGroup.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ function New-AzDoVariableGroup {
88
.EXAMPLE
99
$params = @{
1010
Collectionuri = 'https://dev.azure.com/weareinspark/'
11-
PAT = '*******************'
1211
ProjectName = 'Project 1'
1312
VariableGroupName = 'VariableGroup1'
1413
Variables = @{ test = @{ value = 'test' } }

AzureDevOpsPowerShell/Public/Api/Environments/Environments/Get-AzDoEnvironment.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function Get-AzDoEnvironment {
77
.EXAMPLE
88
$params = @{
99
CollectionUri = "https://dev.azure.com/contoso"
10-
PAT = "***"
1110
Name = "Policy 1"
1211
RepoName = "Repo 1"
1312
ProjectName = "Project 1"

AzureDevOpsPowerShell/Public/Api/Environments/Environments/New-AzDoEnvironment.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function New-AzDoEnvironment {
77
.EXAMPLE
88
$params = @{
99
CollectionUri = "https://dev.azure.com/contoso"
10-
PAT = "***"
1110
Name = "Policy 1"
1211
RepoName = "Repo 1"
1312
ProjectName = "Project 1"

AzureDevOpsPowerShell/Public/Api/Git/Pushes/Add-FilesToRepo.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function Add-FilesToRepo {
77
.EXAMPLE
88
$params = @{
99
CollectionUri = "https://dev.azure.com/contoso"
10-
PAT = "***"
1110
Name = "Repo 1"
1211
ProjectName = "Project 1"
1312
}

AzureDevOpsPowerShell/Public/Api/Git/Repositories/Get-AzDoRepo.ps1

-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function Get-AzDoRepo {
77
.EXAMPLE
88
$Params = @{
99
CollectionUri = "https://dev.azure.com/contoso"
10-
PAT = "***"
1110
ProjectName = "Project 1"
1211
Name "Repo 1"
1312
}
@@ -17,7 +16,6 @@ function Get-AzDoRepo {
1716
.EXAMPLE
1817
$Params = @{
1918
CollectionUri = "https://dev.azure.com/contoso"
20-
PAT = "***"
2119
ProjectName = "Project 1"
2220
Name "Repo 1"
2321
}
@@ -27,7 +25,6 @@ function Get-AzDoRepo {
2725
.EXAMPLE
2826
$Params = @{
2927
CollectionUri = "https://dev.azure.com/contoso"
30-
PAT = "***"
3128
Name "Repo 1"
3229
}
3330
get-AzDoProject -pat $pat -CollectionUri $collectionuri | Get-AzDoRepo -PAT $PAT

AzureDevOpsPowerShell/Public/Api/Git/Repositories/New-AzDoRepo.ps1

-2
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ function New-AzDoRepo {
77
.EXAMPLE
88
$params = @{
99
CollectionUri = "https://dev.azure.com/contoso"
10-
PAT = "***"
1110
Name = "Repo 1"
1211
ProjectName = "Project 1"
1312
}
1413
New-AzDoRepo @params
1514
1615
This example creates a new Azure DevOps repo with splatting parameters
1716
.EXAMPLE
18-
$env:SYSTEM_ACCESSTOKEN = '***'
1917
'test', 'test2' | New-AzDoRepo -CollectionUri "https://dev.azure.com/contoso" -ProjectName "Project 1"
2018
2119
This example creates a new Azure DevOps repo for each in pipeline

AzureDevOpsPowerShell/Public/Api/Pipelines/Pipelines/Get-AzDoPipeline.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function Get-AzDoPipeline {
77
.EXAMPLE
88
$params = @{
99
CollectionUri = "https://dev.azure.com/contoso"
10-
PAT = "***"
1110
Name = "Policy 1"
1211
RepoName = "Repo 1"
1312
ProjectName = "Project 1"

AzureDevOpsPowerShell/Public/Api/Pipelines/Pipelines/New-AzDoPipeline.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function New-AzDoPipeline {
77
.EXAMPLE
88
$newAzDoPipelineSplat = @{
99
CollectionUri = "https://dev.azure.com/contoso"
10-
PAT = "***"
1110
PipelineName = "Pipeline 1"
1211
RepoName = "Repo 1"
1312
ProjectName = "Project 1"

AzureDevOpsPowerShell/Public/Api/Policy/Configuration/Set-AzDoBranchPolicyBuildValidation.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function Set-AzDoBranchPolicyBuildValidation {
77
.EXAMPLE
88
$params = @{
99
CollectionUri = "https://dev.azure.com/contoso"
10-
PAT = "***"
1110
Name = "Policy 1"
1211
RepoName = "Repo 1"
1312
ProjectName = "Project 1"

AzureDevOpsPowerShell/Public/Api/Policy/Configuration/Set-AzDoBranchPolicyCommentResolution.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function Set-AzDoBranchPolicyCommentResolution {
77
.EXAMPLE
88
$params = @{
99
CollectionUri = "https://dev.azure.com/contoso"
10-
PAT = "***"
1110
RepoName = "Repo 1"
1211
ProjectName = "Project 1"
1312
}

AzureDevOpsPowerShell/Public/Api/Policy/Configuration/Set-AzDoBranchPolicyMergeStrategy.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function Set-AzDoBranchPolicyMergeStrategy {
77
.EXAMPLE
88
$params = @{
99
CollectionUri = "https://dev.azure.com/contoso"
10-
PAT = "***"
1110
RepoName = "Repo 1"
1211
ProjectName = "Project 1"
1312
}

AzureDevOpsPowerShell/Public/Api/Policy/Configuration/Set-AzDoBranchPolicyMinimalApproval.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function Set-AzDoBranchPolicyMinimalApproval {
77
.EXAMPLE
88
$params = @{
99
CollectionUri = "https://dev.azure.com/contoso"
10-
PAT = "***"
1110
RepoName = "Repo 1"
1211
ProjectName = "Project 1"
1312
}

AzureDevOpsPowerShell/Public/Api/ServiceEndpoints/Endpointproxy/Test-AzDoServiceConnection.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function Test-AzDoServiceConnection {
77
.EXAMPLE
88
$params = @{
99
CollectionUri = "https://dev.azure.com/contoso"
10-
PAT = "***"
1110
ProjectName = "Project 1"
1211
SubscriptionId = "00000-00000-00000-00000-00000"
1312
SubscriptionName = "Subscription 1"

AzureDevOpsPowerShell/Public/Api/ServiceEndpoints/Endpoints/New-AzDoServiceConnection.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function New-AzDoServiceConnection {
77
.EXAMPLE
88
$params = @{
99
CollectionUri = "https://dev.azure.com/contoso"
10-
PAT = "***"
1110
ProjectName = "Project 1"
1211
SubscriptionId = "00000-00000-00000-00000-00000"
1312
SubscriptionName = "Subscription 1"

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,34 @@
1818

1919
## Overview
2020

21-
Automate tasks in Azure DevOps and Azure AD. Works on Windows Linux and MacOS.
21+
Automate tasks in Azure DevOps. Works on Windows, Linux and MacOS. There are a few good open-source projects already going on this topic (Like VS-Team),
22+
but we believe that this project in more user-friendly.
2223

2324
## Installation
2425

2526
```powershell
27+
# PowerShell 7.3 and below
28+
Install-Module -Name AzureDevOpsPowerShellAPI -Scope CurrentUser
2629
27-
Install-Module -Name AzureDevOpsPowerShellAPI -Scope CurrentUser -Repository InSpark -Credential $InSparkAzureDevopsArtifacts
28-
30+
# PowerShell 7.4 and up
31+
Install-PSresource -Name AzureDevOpsPowerShellAPI -Scope CurrentUser
2932
```
3033

31-
For more information on how to setup access to our repository, please checkout [our guide](https://weareinspark.github.io/AzureDevOpsPowerShellAPI/about_InstallingModule/). The [source documentation on installation can also be found here](https://github.com/WeAreInSpark/AzureDevOpsPowerShellAPI/blob/main/docs/en-US/about_InstallingModule.md).
32-
3334
## Basic Usage
3435

3536
### List all Azure DevOps projects
3637

3738
```powershell
3839
$Params = @{
3940
CollectionUri = "https://dev.azure.com/contoso"
40-
PAT = "***"
4141
}
4242
Get-AzDoProject @params
4343
```
4444

4545
### Create an Azure DevOps Project
4646

4747
```powershell
48-
New-AzDoProject -CollectionUri "https://dev.azure.com/contoso" -PAT "***" -ProjectName "Project 1"
48+
New-AzDoProject -CollectionUri "https://dev.azure.com/contoso" -ProjectName "Project 1"
4949
```
5050

5151
## Contributing

docs/en-US/.pages

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
nav:
22
- Home:
33
- index.md
4-
- ...| about*.md
4+
- ...| About*.md
55
- Modules:
66
- Approvals And Checks:
77
- Check Configurations:
@@ -23,9 +23,6 @@ nav:
2323
- Add-FilesToRepo.md
2424
- Repositories:
2525
- ... | *AzDoRepo.md
26-
- Graph:
27-
- Groups:
28-
- Set-AzDoTeamMember.md
2926
- Pipelines:
3027
- Pipelines:
3128
- ... | *AzDoPipeline.md

docs/en-US/About_Authentication.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Authentication
2+
3+
## Users
4+
5+
When you use the module locally you only have to log in to your Azure tenant with 'Azure PowerShell'.
6+
The module will then fetch a Access token with `Get-AzAccessToken`.
7+
8+
```powershell
9+
Connect-AzAccount
10+
11+
Get-AzDoProject -CollectionUri = "https://dev.azure.com/contoso"
12+
```
13+
14+
## Azure resources
15+
16+
When using the module in for example an Automation Account or an Azure Function you can use the Managed Identity to
17+
give access to the azure DevOps resources. The module can again use the access token to access the resources.
18+
19+
```powershell
20+
Connect-AzAccount -Identity
21+
22+
Get-AzDoProject -CollectionUri = "https://dev.azure.com/contoso"
23+
```
24+
25+
## Azure DevOps
26+
27+
When you use Azure DevOps you can use of the Azure DevOps token to authenticate to Azure. Do not forget to disable the protection setting. You can find the docmentation [here](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/access-tokens?view=azure-devops&tabs=yaml#protect-access-to-repositories-in-yaml-pipelines)
28+
29+
```yaml
30+
steps:
31+
- powershell: |
32+
Set-AzdoPat -Pat "$env:SYSTEM_ACCESSTOKEN"
33+
34+
Get-AzDoProject -CollectionUri = "https://dev.azure.com/contoso"
35+
env:
36+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
37+
```

0 commit comments

Comments
 (0)