Skip to content

docs: fixing docs #54

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

Merged
merged 1 commit into from
Feb 9, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ function Set-AzDoProjectSetting {
.EXAMPLE
$params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
ProjectName = "Project01"
EnforceJobAuthScope = $true
EnforceJobAuthScopeForReleases = $true
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ function Get-AzDoProject {
.EXAMPLE
$Params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
}
Get-AzDoProject @params

@@ -16,7 +15,6 @@ function Get-AzDoProject {
.EXAMPLE
$Params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
ProjectName = 'Project1'
}
Get-AzDoProject @params
@@ -26,7 +24,6 @@ function Get-AzDoProject {
.EXAMPLE
$params = @{
collectionuri = "https://dev.azure.com/contoso"
PAT = "***"
}
$somedifferentobject = [PSCustomObject]@{
ProjectName = 'Project1'
@@ -38,7 +35,6 @@ function Get-AzDoProject {
.EXAMPLE
$params = @{
collectionuri = "https://dev.azure.com/contoso"
PAT = "***"
}
@(
'Project1',
Original file line number Diff line number Diff line change
@@ -5,15 +5,15 @@ function Remove-AzDoProject {
.DESCRIPTION
Function to create an Azure DevOps project
.EXAMPLE
New-AzDoProject -CollectionUri "https://dev.azure.com/contoso" -PAT "***" -ProjectName "Project 1"
New-AzDoProject -CollectionUri "https://dev.azure.com/contoso" -ProjectName "Project 1"

This example creates a new private Azure DevOps project
.EXAMPLE
New-AzDoProject -CollectionUri "https://dev.azure.com/contoso" -PAT "***" -ProjectName "Project 1" -Visibility 'public'
New-AzDoProject -CollectionUri "https://dev.azure.com/contoso" -ProjectName "Project 1" -Visibility 'public'

This example creates a new public Azure DevOps project
.EXAMPLE
@("MyProject1","Myproject2") | New-AzDoProject -CollectionUri "https://dev.azure.com/contoso" -PAT "***"
@("MyProject1","Myproject2") | New-AzDoProject -CollectionUri "https://dev.azure.com/contoso"

This example creates two new Azure DevOps projects using the pipeline.

Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ function Add-AzDoVariableGroupVariable {
$splat = @{
CollectionUri = 'https://dev.azure.com/ChristianPiet0452/'
ProjectName = 'Ditproject'
PAT = '*******************'
VariableGroupName = @('Group1', 'Group2')
Variables = @{
test = @{
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ function Get-AzDoVariableGroup {
.EXAMPLE
$params = @{
Collectionuri = 'https://dev.azure.com/weareinspark/'
PAT = '*******************'
ProjectName = 'Project 1'
VariableGroupName = 'VariableGroup1','VariableGroup2'
}
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ function New-AzDoVariableGroup {
.EXAMPLE
$params = @{
Collectionuri = 'https://dev.azure.com/weareinspark/'
PAT = '*******************'
ProjectName = 'Project 1'
VariableGroupName = 'VariableGroup1'
Variables = @{ test = @{ value = 'test' } }
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ function Get-AzDoEnvironment {
.EXAMPLE
$params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
Name = "Policy 1"
RepoName = "Repo 1"
ProjectName = "Project 1"
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ function New-AzDoEnvironment {
.EXAMPLE
$params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
Name = "Policy 1"
RepoName = "Repo 1"
ProjectName = "Project 1"
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ function Add-FilesToRepo {
.EXAMPLE
$params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
Name = "Repo 1"
ProjectName = "Project 1"
}
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ function Get-AzDoRepo {
.EXAMPLE
$Params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
ProjectName = "Project 1"
Name "Repo 1"
}
@@ -17,7 +16,6 @@ function Get-AzDoRepo {
.EXAMPLE
$Params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
ProjectName = "Project 1"
Name "Repo 1"
}
@@ -27,7 +25,6 @@ function Get-AzDoRepo {
.EXAMPLE
$Params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
Name "Repo 1"
}
get-AzDoProject -pat $pat -CollectionUri $collectionuri | Get-AzDoRepo -PAT $PAT
Original file line number Diff line number Diff line change
@@ -7,15 +7,13 @@ function New-AzDoRepo {
.EXAMPLE
$params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
Name = "Repo 1"
ProjectName = "Project 1"
}
New-AzDoRepo @params

This example creates a new Azure DevOps repo with splatting parameters
.EXAMPLE
$env:SYSTEM_ACCESSTOKEN = '***'
'test', 'test2' | New-AzDoRepo -CollectionUri "https://dev.azure.com/contoso" -ProjectName "Project 1"

This example creates a new Azure DevOps repo for each in pipeline
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ function Get-AzDoPipeline {
.EXAMPLE
$params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
Name = "Policy 1"
RepoName = "Repo 1"
ProjectName = "Project 1"
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ function New-AzDoPipeline {
.EXAMPLE
$newAzDoPipelineSplat = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
PipelineName = "Pipeline 1"
RepoName = "Repo 1"
ProjectName = "Project 1"
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ function Set-AzDoBranchPolicyBuildValidation {
.EXAMPLE
$params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
Name = "Policy 1"
RepoName = "Repo 1"
ProjectName = "Project 1"
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ function Set-AzDoBranchPolicyCommentResolution {
.EXAMPLE
$params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
RepoName = "Repo 1"
ProjectName = "Project 1"
}
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ function Set-AzDoBranchPolicyMergeStrategy {
.EXAMPLE
$params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
RepoName = "Repo 1"
ProjectName = "Project 1"
}
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ function Set-AzDoBranchPolicyMinimalApproval {
.EXAMPLE
$params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
RepoName = "Repo 1"
ProjectName = "Project 1"
}
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ function Test-AzDoServiceConnection {
.EXAMPLE
$params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
ProjectName = "Project 1"
SubscriptionId = "00000-00000-00000-00000-00000"
SubscriptionName = "Subscription 1"
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ function New-AzDoServiceConnection {
.EXAMPLE
$params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
ProjectName = "Project 1"
SubscriptionId = "00000-00000-00000-00000-00000"
SubscriptionName = "Subscription 1"
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -18,34 +18,34 @@

## Overview

Automate tasks in Azure DevOps and Azure AD. Works on Windows Linux and MacOS.
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),
but we believe that this project in more user-friendly.

## Installation

```powershell
# PowerShell 7.3 and below
Install-Module -Name AzureDevOpsPowerShellAPI -Scope CurrentUser

Install-Module -Name AzureDevOpsPowerShellAPI -Scope CurrentUser -Repository InSpark -Credential $InSparkAzureDevopsArtifacts

# PowerShell 7.4 and up
Install-PSresource -Name AzureDevOpsPowerShellAPI -Scope CurrentUser
```

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).

## Basic Usage

### List all Azure DevOps projects

```powershell
$Params = @{
CollectionUri = "https://dev.azure.com/contoso"
PAT = "***"
}
Get-AzDoProject @params
```

### Create an Azure DevOps Project

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

## Contributing
5 changes: 1 addition & 4 deletions docs/en-US/.pages
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
nav:
- Home:
- index.md
- ...| about*.md
- ...| About*.md
- Modules:
- Approvals And Checks:
- Check Configurations:
@@ -23,9 +23,6 @@ nav:
- Add-FilesToRepo.md
- Repositories:
- ... | *AzDoRepo.md
- Graph:
- Groups:
- Set-AzDoTeamMember.md
- Pipelines:
- Pipelines:
- ... | *AzDoPipeline.md
37 changes: 37 additions & 0 deletions docs/en-US/About_Authentication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Authentication

## Users

When you use the module locally you only have to log in to your Azure tenant with 'Azure PowerShell'.
The module will then fetch a Access token with `Get-AzAccessToken`.

```powershell
Connect-AzAccount

Get-AzDoProject -CollectionUri = "https://dev.azure.com/contoso"
```

## Azure resources

When using the module in for example an Automation Account or an Azure Function you can use the Managed Identity to
give access to the azure DevOps resources. The module can again use the access token to access the resources.

```powershell
Connect-AzAccount -Identity

Get-AzDoProject -CollectionUri = "https://dev.azure.com/contoso"
```

## Azure DevOps

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)

```yaml
steps:
- powershell: |
Set-AzdoPat -Pat "$env:SYSTEM_ACCESSTOKEN"

Get-AzDoProject -CollectionUri = "https://dev.azure.com/contoso"
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
```
Loading