diff --git a/Powershell/Lists/DevOps/Pipelines.ps1 b/Powershell/Lists/DevOps/Pipelines.ps1 new file mode 100644 index 0000000..41d8758 --- /dev/null +++ b/Powershell/Lists/DevOps/Pipelines.ps1 @@ -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." \ No newline at end of file diff --git a/Powershell/Lists/DevOps/PullRequests.ps1 b/Powershell/Lists/DevOps/PullRequests.ps1 index fbc4492..498e579 100644 --- a/Powershell/Lists/DevOps/PullRequests.ps1 +++ b/Powershell/Lists/DevOps/PullRequests.ps1 @@ -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 } diff --git a/Powershell/Lists/SQL/SQLUserCheck.ps1 b/Powershell/Lists/SQL/SQLUserCheck.ps1 index 1bc8efa..e38dc02 100644 --- a/Powershell/Lists/SQL/SQLUserCheck.ps1 +++ b/Powershell/Lists/SQL/SQLUserCheck.ps1 @@ -21,7 +21,7 @@ class UserItem { [string] $AuthenticationType = "" } -$serverList= @('c0m7f8nybr.database.windows.net','calculations.database.windows.net','effectory.database.windows.net','effectorycore.database.windows.net', 'logit-backup.database.windows.net', 'mhpfktialk.database.windows.net', 'participants.database.windows.net', 'signin-effectory.database.windows.net', 'sqlserver01prod.6a1f4aa9f43a.database.windows.net', 'teamie.database.windows.net') +$serverList= @('c0m7f8nybr.database.windows.net','calculations.database.windows.net','effectory.database.windows.net','effectorycore.database.windows.net', 'logit-backup.database.windows.net', 'mhpfktialk.database.windows.net', 'participants.database.windows.net', 'signin-effectory.database.windows.net', 'sqlserver01prod.6a1f4aa9f43a.database.windows.net') # 'sqlserver01test.164709c94fb0.database.windows.net', 'replication.database.windows.net', @@ -40,7 +40,7 @@ select @@SERVERNAME as serverName, type_desc as type, authentication_type_desc as authentication_type from sys.database_principals -where type not in ('A', 'G', 'R', 'X') +where type not in ('R') and sid is not null and name != 'guest' order by name; diff --git a/format.json b/format.json deleted file mode 100644 index e69de29..0000000