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:
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.
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.
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.
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.
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:
Intro Today, we have released a new version of PowervRA, 4.0.0 with support for vRA Cloud and vRA on-premises version 8.0. The observant among you will notice that we’ve incremented the PowervRA version from 3.7.0 to 4.0.0. We’ve done this since there is a significant breaking change. The API for vRA Cloud / 8.0 is completely different to that which exists for vRA 7.x and earlier. If you’ve been with the product for a while you’ll be aware of the pain challenge it has been to work with since inception due to the split brain nature of the product, more info here and here.
Recently I was invited to contribute to a week of blogging to coincide with the release of PowerShell 7 to help showcase some of the new features available. To follow up on that content, Jeff Hicks has put in some fantastic effort, collated all of the content and wrapped it up all into one place in an Ebook available from Leanpub. Technically it’s possible to get hold of a copy from there for free.
In a previous post I have written about Running PowerShell Core Commands Directly on Ansible Localhost using the version of PowerShell Core available at that time 6.2.3. With the recent release of PowerShell 7 I will demonstrate how to achieve the same outcome with this newer version and also an example taking advantage of one of the new features. My awx_task container is based on Centos 8 and installation for PowerShell 7 is the same process as for 6.
Prior to PowerShell version 7 there were a number of different methods for running PowerShell tasks in parallel, for example creating your own runspaces manually or using a third-party module such as Invoke-Parallel or PoshRSJob to make that a little more straightforward. Not to be confused of course with the foreach -parallel language construct, which exists, but is only available via a Windows PowerShell workflow. For an excellent summary of the different options prior to v7, I would highly recommend checking out Richard Siddaway’s talk from PSDayUK 2019 which provides some great insight.