mirror of
https://dev.azure.com/effectory/Survey%20Software/_git/Cloud%20Engineering
synced 2026-02-27 18:52:18 +01:00
Merged PR 53135: soc2 audit list changes
soc2 audit list changes #103958 #103959 Related work items: #103958, #103959
This commit is contained in:
65
Powershell/Lists/DevOps/Pipelines.ps1
Normal file
65
Powershell/Lists/DevOps/Pipelines.ps1
Normal file
@@ -0,0 +1,65 @@
|
||||
|
||||
class PipelineInfo {
|
||||
[string] $Id = ""
|
||||
[string] $Name = ""
|
||||
[string] $Path = ""
|
||||
[string] $Type = ""
|
||||
[string] $Author = ""
|
||||
[string] $CreatedDate = ""
|
||||
[string] $PipelineType = ""
|
||||
[string] $PipelineEditUrl = ""
|
||||
}
|
||||
|
||||
$token = "hyrvwxicogy37djvmhkwrcdexokcrpyudkk4j2n3n7gnjb5wsv5a"
|
||||
$token = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($token)"))
|
||||
$organization = "effectory"
|
||||
$project = "Survey%20Software"
|
||||
$head = @{ Authorization =" Basic $token" }
|
||||
|
||||
function GetPipelineType {
|
||||
|
||||
param (
|
||||
[int] $pipeLineId
|
||||
)
|
||||
|
||||
$url = "https://dev.azure.com/$organization/$project/_apps/hub/ms.vss-build-web.ci-designer-hub?pipelineId=$pipeLineId&__rt=fps&__ver=2"
|
||||
$response = Invoke-RestMethod -Uri $url -Method GET -Headers $head
|
||||
return $response.fps.dataProviders.data."ms.vss-build-web.pipeline-detail-data-provider".definitionProcessType
|
||||
}
|
||||
|
||||
[string] $date = Get-Date -Format "yyyy-MM-dd HHmm"
|
||||
$fileName = ".\$date pipelines.csv"
|
||||
|
||||
Write-Host "========================================================================================================================================================================"
|
||||
Write-Host "Creating service connection overview."
|
||||
Write-Host "========================================================================================================================================================================"
|
||||
|
||||
|
||||
$url="https://dev.azure.com/$organization/$project/_apis/build/definitions?api-version=7.1-preview.7"
|
||||
$response = Invoke-RestMethod -Uri $url -Method GET -Headers $head
|
||||
|
||||
[PipelineInfo[]]$Result = @()
|
||||
$response.value | ForEach-Object {
|
||||
|
||||
$definitionProcessType = GetPipelineType -pipeLineId $_.id
|
||||
|
||||
[PipelineInfo] $pipelineInfo = [PipelineInfo]::new()
|
||||
$pipelineInfo.Id = $_.id
|
||||
$pipelineInfo.Name = $_.name
|
||||
$pipelineInfo.Path = $_.path
|
||||
$pipelineInfo.Type = $_.type
|
||||
$pipelineInfo.Author = $_.authoredby.DisplayName
|
||||
$pipelineInfo.CreatedDate = $_.createdDate
|
||||
$pipelineInfo.PipelineType = $definitionProcessType -eq 1 ? "Classic" : "Yaml"
|
||||
$pipelineInfo.PipelineEditUrl = $definitionProcessType -eq 1 ?
|
||||
"https://dev.azure.com/$organization/$project/_apps/hub/ms.vss-ciworkflow.build-ci-hub?_a=edit-build-definition&id=$($_.id)" :
|
||||
"https://dev.azure.com/$organization/$project/_apps/hub/ms.vss-build-web.ci-designer-hub?pipelineId=$($_.id)&branch=master"
|
||||
$Result += $pipelineInfo
|
||||
|
||||
|
||||
}
|
||||
|
||||
$Result | Export-Csv -Path $fileName -Append -NoTypeInformation
|
||||
|
||||
Write-Host "========================================================================================================================================================================"
|
||||
Write-Host "Done."
|
||||
@@ -17,7 +17,7 @@ class PullRequest {
|
||||
$fileName = ".\$date pull requests.csv"
|
||||
|
||||
Write-Host "========================================================================================================================================================================"
|
||||
Write-Host "Creating repository overview."
|
||||
Write-Host "Creating pull request overview."
|
||||
Write-Host "========================================================================================================================================================================"
|
||||
|
||||
$repos = az repos list --organization "https://dev.azure.com/effectory/" --project "survey software" | ConvertFrom-Json | Select-Object | Where-Object { $true -ne $_.isDisabled }
|
||||
|
||||
Reference in New Issue
Block a user