SonarScanner CLI Docker in GitHub Actions

When using SonarQube’s SonarScanner CLI in GitHub Actions it may not always be possible to use the official public action, perhaps your organisation doesn’t permit public actions, or only approves specific ones. In such cases you may look to create your own internal action and SonarQube provide their SonarScanner CLI tool in a Docker image for easy consumption. The documentation gives you an example on how to create a container using their image:

Automating SonarCloud with PowerShell – Part 3 Onboarding a User

Warning: this post contains unsupported API calls, so use at your own risk Similar to the situation in Part 2 for onboarding a project into SonarCloud, onboarding a user into an organization is also not supported via the public API. In the API documentation there is no entry for api/organizations This was confirmed by a community posting and unfortunately did not appear on the roadmap: Back to Chrome Developer Tools So in the same way as in Part 2 I used Chrome Developer Tools to monitor what happens in the SonarCloud UI when adding a member to an organization:

Automating SonarCloud with PowerShell – Part 2 Onboarding a Project

Warning: this post contains unsupported API calls, so use at your own risk One of the main reasons I started looking at the SonarCloud api was to be able to automate the onboarding of new GitLab projects into SonarCloud. We didn’t want to have to do that manually via the UI, rather via a pipeline job. In part 1 of this series I demonstrated the basics of the API and the PSSonarCloud PowerShell module, in part 2 we’ll look at how to onboard a project into SonarCloud.

Automating SonarCloud with PowerShell - Part 1 Introduction

SonarCloud is the SaaS version of SonarQube, a tool to detect and fix issues in your code by examining code quality and security vulnerabilities. I needed to automate the onboarding of both users and code projects into SonarCloud to take away the need to manually provision these items into the system. SonarCloud has a Web API which facilitated a lot of what I needed to achieve, however with some significant gaps which initially appeared to mean some of the onboarding would need to still be manual.

Authenticating to GitHub using Git for Windows and a Personal Access Token fails

While following this guide to migrate to using multiple GitHub HTTPS accounts on Windows from a single user account I have used for years, I had to remove my existing GitHub.com credentials from Windows Credential Manager. When re-authenticating via the prompted login window: to existing repos on GitHub.com using an existing Personal Access Token or authenticating to a new repo using a different account on an instance of GitHub Enterprise using a new Personal Access Token, I would receive a combination of the following errors:

PowerShell Brickset Module version 2.0.1+: Downloading Lego Instructions

The most common question I get asked about the PowerShell Brickset Module is how to use it to download the online PDF instructions Lego produce to accompany each set. The Get-BricksetSetInstructions function is what you need for this task. A variation on this question is around Lego sets which contain multiple instruction booklets, since Get-BricksetSetInstructions will return a link to each of the PDFs for that set. There are some examples in a previous article which may cover what you are looking for.

PowerShell Brickset Module: Updated for API v3 and PS 7.1

Brickset recently updated their API to v3 and stopped supporting the previous API v2. After receiving a number of requests to update my PowerShell module for Brickset , (which was developed against v2 and consequently had stopped working), both via a GitHub issue and some direct contact (including, surprisingly to me, internal email at work) I decided I’d better put some effort into updating it. I’d had a quick look at the v3 API not long after it had been made available, and as far as I remember it was still only SOAP based.

HashiCorp Certified: Terraform Associate - Exam Experience

A few weeks ago I took the HashiCorp Certified: Terraform Associate Exam. As part of a learning exercise to get more experience with this technology, having had some basic hands-on experience I booked the exam a short while in advance to have a target to focus the learning. I used a combination of the online certification guide at Hashicorp and a few courses available from Pluralsight by Ned Bellavance: Terraform - Getting Started Terraform Deep Dive Implementing Terraform on Microsoft Azure The guide at Hashicorp was excellent for covering the basics with a particular focus on the exam topics.

Combine Two JSON Files With PowerShell

Over the years I’ve used a few different methods to combine two JSON files using PowerShell, but today I found a neat way to do it, so thought I would document it here for easy recall next time I need to do it. Consider two basic JSON files to use for an example: It’s easy to start working with them as objects in PowerShell, but I always forget that you can’t then just concatenate them together since they are PSCustomObjects:

AZ-400 Azure DevOps Exam Experience

I passed the AZ-400 Azure DevOps exam last week, so thought I would share a few thoughts for anyone else considering it. I mostly used the AZ-400 course on Linux Academy by Tim Lawless to study for it and found it an excellent resource. I thought Tim did a great job of not just covering the topics as per the published curriculum, but also went further into illustrating many of the third-party integrations with Azure DevOps.