Introduction
It is often easier to develop PowerShell scripts that are intended to run in Azure by first running and debugging them on a local desktop computer. This is how the existing Speakeasy scripts have been developed. To do this, a few steps need to be performed to make sure that all the appropriate software is configured on that computer. This document aims to highlight the requirements to ensure successful execution of the scripts on a local computer.
Requirements
PowerShell
The Azure Powershell scripts use two different PowerShell versions. At the time of writing, Speakeasy report generation would not work with V7.1 due to issues with the PDF component, so V5.1 was used. The following link shows the various versions used:
Speakeasy Automation Runbooks in Azure
Install V5.1 and V7.1 of PowerShell – it is recommended this is done using the latest .MSI files
Visual Studio Code
For PowerShell 5.1, PowerShell ISE can be used to develop and debug scripts. However, this is being phased out so it is recommended that Visual Studio Code be used. When trying to run PowerShell scripts for the first time in Visual Studio code, the user will be prompted to install additional addins to support PowerShell – when prompted, say yes to install them. The components below can then be installed by executing the stated commands from inside the Visual Studio Code – Terminal window
Note: since this guide was written, a new extension has been added to Visual Studio Code which enable Azure runbooks to be executed directly on the local computer (currently, when developing locally, a copy of the script is made, which is not ideal). Once the extension has been tried, some of the requirements listed below may need to be changed. However, for now, follow these as listed.
Azure Connectivity
Sharepoint Connectivity
Exchange Connectivity
Digital Certificate
Digital Certificate Password