Ansible, Windows and PowerShell: the Basics - Introduction

Back in June of this year I presented a session at PowerShell Southampton on using Ansible and PowerShell together. There was a fair amount of interest in this topic both at the event and online afterwards, so I decided to follow it up here with a series of posts looking at the basics for someone getting started with Ansible. In particular using it to automate and configure Windows, where to use PowerShell for that task and sometimes where not to if there is native functionality already available within Ansible.

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 - 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.