Skip to content

Powershell Setup

Is there anything that doesn’t work?

To quote Hamlet, Act 3, Scene 3, Line 87: “No.”


Admin Rights required

1. Install Powershell 7

Run this command


2. Update PowerShellGet

Register-PackageSource -Name MyNuGet -Location -ProviderName NuGet
Install-PackageProvider -Name NuGet -Force
Install-Module -Name PowerShellGet -Force -AllowClobber
Update-Module -Name PowerShellGet

3. Install Module for Azure

Install the Powershell Modules you would like to use e.g.:

Install-Module -Name Az -AllowClobber -Force -scope AllUsers
Install-Module -Name AzureAD -AllowClobber -Force -scope AllUsers
Install-Module -Name PSScriptAnalyzer -AllowClobber -Force -scope AllUsers

Consider updating them from time to time with this command:

Update-Module -scope AllUsers -Force


Install powershell on Ubuntu 20.04

sudo apt update # Update the list of packages
sudo apt install -y wget apt-transport-https software-properties-common # Install pre-requisite packages.
wget -q # Download the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb # Register the Microsoft repository GPG keys
sudo apt update # Update the list of products
sudo add-apt-repository universe # Enable the "universe" repositories
sudo apt install -y powershell # Install PowerShell
pwsh # Start PowerShell


Use the latest Modules

For example Az modules can be installed in various versions when updated. Follow these three steps to update, find old modules and delete all but the latest:

1. Update Az.Modules:

Update-Module -Name Az

2. Find out what versions you have installed

Get-InstalledModule -Name Az -AllVersions | Select-Object -Property Name, Version

3. Delete the older Module (or all and start over)

Install the module "Az.Tools.Installer" to be able to delete an older Az Module version:

Install-Module -Name Az.Tools.Installer
Uninstall-AzModule -Name Az


  • Pester is the ubiquitous test and mock framework for PowerShell.
  • EPS is a templating engine for PowerShell.