Update 18/01/2021: See this post for details on an updated version of this module, parts of the below may now be out of date.
In part 1 of this series, we looked at how to get started with the Brickset module. In part 2 we’ll take a look at how to easily download sets of instructions.
It may be the case that you have lost the set of instructions for a Lego set or perhaps you have got hold of a set secondhand that didn’t have the instructions to accompany it.
Update 18/01/2021: See this post for details on an updated version of this module, parts of the below may now be out of date.
I recently gave my PowerShell Brickset Module a much needed overhaul, so thought it was worth putting a few posts out on how it works and what you can do with it. In part 1 we’ll look at getting started, including download and installation.
Brickset is an extremely useful site for keeping up-to-date with Lego based news and managing your own collection of brick based goodness.
It seems hard to believe, but this year sees PowerShell having been around for 10 years! From the early beginnings of increasing awareness and adoption, through becoming a fundamental part of Windows and now having been made Open Source, it’s been quite a journey.
To celebrate this, the PowerShell team has arranged a day of online streaming events on their Channel 9 platform: Monday November 14th from 8:00 am to 4:00 pm (PST).
vRealize Orchestrator doesn’t have an in-built Unit Test Framework, however I realised that it might be possible to use a combination of Pester and PowervRO for now to achieve similar results. Let’s take a look at an example using a very simple workflow, Workflow1. Workflow1 has two inputs, a and b, both numbers:
Workflow1 has a single scriptable task that takes the inputs a and b, multiples them together and stores the result in c, which is output from the workflow.
When a file is imported into vRO to be used as a Resource Element, a MIME type is automatically set depending on what has been imported. For instance, in the below example a shell script has been imported, the contents of which will be used as part of some vRO automation - notice the MIME type has been set to application/x-sh.
This doesn’t really cause a problem in itself when using the Resource Element in a workflow, however vRO doesn’t display the content of all MIME types when looking at the file in the Viewer tab and may display the message “cannot display this kind of element” instead - *.
Update 29/09/2016:
The API documentation for importing a vRA Content Package contains a warning:
At this point, we don’t support any form of rollback strategies. A failed import may potentially leave the system in an inconsistent state. Hence, its highly recommend to run a precheck/dry-run before the import to validate the package. See HTTP POST /api/packages/validate for more details. This will help catch most of the errors upfront.
Consequently, in release 1.
One thing that I know colleagues and others are keen to automate with PowerShell and vRO is exporting and importing vRO packages. If you’re not familiar with a vRO package it is typically used to bundle up all of the Workflows / Actions / Configuration Elements / Resource Elements which make up the code for a particular project and use the package to transport the code to another system. So you may for instance wish to export a package and copy it to another vRO server or maybe into a version control system, or you may wish to automate the deployment of vRO itself and include importing the code as a final step.
Aside from any documentation around your vRO workflows, one of the best ways to quickly get up-to-speed with what it does and visualise how it is put together is to look at the schema. Wouldn’t it be handy if you could easily get hold of an image of the schema for one or multiple workflows? Well with PowervRO and your PowerShell console you can!
The REST API supports this, so we have included a function Export-vROWorkflowSchema .
There are a number of different ways to get your developed vRO content from one system to another: exporting / importing single items, exporting / importing vRO Packages containing multiple items, synchronising content directly between vRO systems.
In this example I’ll show you how to use PowervRO to export and import workflows from and to vRO.
Export vRO Workflows
To export a single workflow is pretty straightforward with the function Export-vROWorkflow:
In the previous episode we looked at how to invoke a vRO workflow with PowerShell, via PowervRO and the Invoke-vROWorkflow function. Once you have kicked the workflow off you are likely to then want to find out the state of the workflow, when it has finished and any output from the workflow. Here’s how to do this via PowervRO.
Check the Workflow State:
First of all, we need to identify which execution of a particular workflow we want to check the state of.