Returning Data from PowerShell Scripts to be consumed by Ansible Playbooks

This topic was not initially obvious to me, so hopefully it will help someone out reading this. Consider the scenario where you have an Ansible playbook which executes some PowerShell code via win_shell and you wish to consume the PowerShell output later on in the playbook. The output from win_shell is available in the return value stdout (The command standard output ) or stdout_lines (The command standard output split in lines ).

Ansible: set_fact cannot access facts created in the same step

Using Ansible and the set_fact module, it is possible to set multiple facts within the same step, e.g. I discovered though that it is not possible to set multiple facts within the same step, if one of them references another created in the same step. For example, something like the following where results_a and results_b are both used to determine total_results: This will generate an error similar to the following:

Issue Removing SMB1 from Windows with Ansible

As part of a large configuration script for Windows, and executed via Ansible, one step was to remove SMB1. The official Microsoft Guidance on removing SMB1 states to use Disable-WindowsFeature - https://support.microsoft.com/en-gb/help/2696547/detect-enable-disable-smbv1-smbv2-smbv3-in-windows-and-windows-server I didn’t think too much more of this and simply added the step to the configuration script. However, upon executing it from Ansible I received the following error: This got me questioning why is the recommendation to use Disable-WindowsOptionalFeature when the detect method is Get-WindowsFeature?

Issues Installing SCVMM via Ansible and PowerShell

While working on a scenario where I needed to automate the installation of SCVMM 2019, firstly via PowerShell scripts and then those scripts plugged into an Ansible playbook, I encountered some failures during the Ansible execution of the PowerShell scripts. These same scripts had worked fine when run locally on the Windows 2016 Server designated to run SCVMM. The PowerShell scripts automated the install of three components; SQL, ADK and SCVMM.

PSDayUK 28th September 2019

Following on from the highly successful 1 day PowerShell conference events run in 2017 and 2018 this year we are heading out of London and up to the International Convention Centre in Birmingham. See full details below: https://psday.uk/ We’re SO excited to announce the final date and location of PSDay.UK 2019. Please join us this year on Saturday 28th September 2019 in Birmingham at the International Convention Centre (ICC) for a fun day learning PowerShell, DevOps, Cloud & Automation from community & industry experts for Beginners to Advanced practitioners.

Resources for the Google Cloud Architect Certification

I recently passed the certification exam for Google Cloud Certified Professional Cloud Architect. A number of people asked me for the resources I used to get through the exam, so I thought I would share them here. One word of context. The exam is only Pass or Fail, you are given no indication of how close you were to the level required. Consequently, I do not know whether the extra effort I put in over and above attending a training course was actually necessary.

PSDayUK 10th October 2018

On Wednesday 10th October 2018 a group of people involved with organising PowerShell User Group events around the UK will be hosting a 1 day PowerShell conference at CodeNode in London, PSDayUK. This follows on from the highly successful event run last year. Updated 3rd August 2018: An agenda will be published soon, once the session submissions have been reviewed. If you are interested in presenting then please fill out this form and your submission will be included in the review process.

List Installed Jenkins Plugins with PowerShell

While looking to automate the installation of Jenkins I needed to get a list of installed plugins into a plugins.txt file to be used by the automated install process. It’s possible to view them in the GUI, but not get an easy export: It’s possible to query the API to get this information: Note: my test Jenkins server is not https, hence the need for the AllowUnencryptedAuthentication parameter

Visual Studio Live Share - Initial Experiences

I saw a demo of Visual Studio Live Share last year and thought it looked pretty cool. If you are not aware of what it is, it allows you to collaborate on code projects with other developers without the need for some kind of screen sharing solution. I work remotely in a development team and we often use screen sharing solutions to assist or get assistance from each other, demonstrate what we’ve been doing or just bounce some ideas off of someone else which can often help you get past problems when you are not physically sitting near your colleagues.

Panini World Cup 2018 Sticker Collection Tracker

I made an Excel based Panini sticker collection tracker for Euro 2016, so thought I would update it for the World Cup 2018 in Russia. On the Data sheet track via the colour used in cell A38 which stickers you have got, then you can easily see which ones you still need. On the Swaps sheet, list out your swaps: Then on the Analysis sheet you will get some figures and graphs to track your collecting progress: