title: How to detect which version of the Az PowerShell module collection is installed on an Azure DevOps agent?
body: <p>On Azure DevOps agents there is no Az module collection installed - <code>Get-InstalledModule Az</code> returns <code>$null</code>. But all Az modules are just available - <code>Get-Module Az* -ListAvailable</code> returns them all. </p>
  
  <p>What is the best way to test if a particular version of the Az module collection is available? Unfortunately the Az module itself is not present in the regular module space; it only appears in the list of installed modules if installed: <code>Get-Module Az -ListAvailable</code> always returns <code>$null</code>.</p>
  
  <p>Just to be sure we always test whether a particular minimum version of the Az module collection is installed. And if not, then we install it. As this easily takes a couple of minutes to complete, ideally we only do it when really necessary.</p>