Skip to content

Instantly share code, notes, and snippets.

View JasperGilhuis's full-sized avatar
:octocat:

Jasper Gilhuis JasperGilhuis

:octocat:
View GitHub Profile
@JasperGilhuis
JasperGilhuis / BOM-Dependecy-Track-PUT.ps1
Created April 15, 2020 20:52
Upload BOM to Dependency-Track using PUT method
try {
$xml = Get-Content (Join-Path $PSScriptRoot ".\bom.xml") -Raw
$ProjectGuid = "d78bc750-d6db-4805-9836-5d77075ec37a"
$ApiKey = "6Ue2f8uVfRiVGpdowjWfF3yW02ryA7Uc"
$Uri = "http://localhost:8080"
$Body = ([PSCustomObject] @{
project = $ProjectGuid
bom = ([Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($xml)))
@JasperGilhuis
JasperGilhuis / Run-Dependency-Track-Container.ps1
Created April 15, 2020 20:41
Run Dependency-Track Container
docker pull owasp/dependency-track
docker volume create --name dependency-track
docker run -d -m 8192m -p 8080:8080 --name dependency-track -v dependency-track:/data owasp/dependency-track
@JasperGilhuis
JasperGilhuis / BOM-Dependecy-Track.ps1
Created April 15, 2020 20:31
Add BOM to Dependency-Track through PowerShell
try {
Set-Location $PSScriptRoot
$ProjectGuid = "d78bc750-d6db-4805-9836-5d77075ec37a"
$ApiKey = "6Ue2f8uVfRiVGpdowjWfF3yW02ryA7Uc"
$Uri = "http://localhost:8080/api/v1/bom"
$FileName = "bom.xml"
$ContentType = "multipart/form-data"
@JasperGilhuis
JasperGilhuis / TeamAdmins.ps1
Last active April 1, 2020 08:35
AZ DevOps CLI - Add Team Administrator
# Adding a Team Administrator
# credits: David https://stackoverflow.com/questions/59829312/how-to-add-team-administrator-using-azure-cli/60062489
$myOrg = "https://dev.azure.com/<<your org>>/"
$newTeam = "Test Team"
$newAdmin = "<<user email>>"
$myProject = "Boards Demo"
echo $env:PAT | az devops login --organization $myOrg