Skip to content

enhance(task-library): Add PowerShell and PowerCLI installers

Shane Gibson requested to merge add-powershell-powercli-install into v4

Adds new stages/tasks and workorder blueprints to install PowerShell and PowerCLI.

Current features are to check if existing tools are installed and exit if so; if not, then install the latest version available. Future enhancements should check to upgrade if desired/needed, specify explicit versions to install, etc.

This tooling relies partially on the Microsoft maintained multi-OS/Distro installer scripts found at: https://github.com/PowerShell/PowerShell/tree/master/tools

Some key OSes that we regularly support and use are not supported by the tooling, and this MR contains OS specific install capabilities for those (eg PhotonOS Linux, Alpine Linux). In addition, the Microsoft tooling seems to not correctly calculate package dependencies for Redhat based (rhelish) distros, and this tooling attempts to correct that.

In the Stage and Blueprint PowerCLI objects, the PowerShell tasks are called as PowwerShell is a prerequisite for PowerCLI.

The following OSes were tested:

PhotonOS Linux 5, Alpine Linux, Fedora 38, Alma 8.8, Ubuntu 22.04

Merge request reports