Skip to content

Bug: Test-Tooling.ps1 fails when ALZ module is installed in AllUser scope #509

@Marc013

Description

@Marc013

Is there an existing issue for this?

  • I have searched the existing issues

Infrastructure as Code Type? (Required)

bicep

PowerShell Module Version (Optional)

5.1.3

Bootstrap Module Version (Optional)

No response

Starter Module? (Required)

bicep - platform_landing_zone

Starter Module Version (Optional)

No response

Input arguments of the ALZ-PowerShell-Module (Optional)

Running function Deploy-Accelerator fails as the ALZ module is installed in the AllUser scope.

Deploy-Accelerator @acceleratorParameters
Checking the software requirements for the Accelerator...
Get-InstalledPSResource: C:\Program Files\PowerShell\Modules\ALZ\5.1.3\Private\Tools\Test-Tooling.ps1:165
Line |
 165 |$alzModuleCurrentVersion = Get-InstalledPSResource -Name ALZ | Selec …
     |                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | No match was found for package 'ALZ'.

Check Result Check Details
------------ -------------
Success      PowerShell version 7.5.4 is supported.
Success      Git is installed.
Success      Azure CLI is installed.
Success      Azure CLI is logged in. Tenant ID: 32f418e5-5e14-46f9-922c-7ef02d7c74db, Subscription: sub-plzmanagement-prod-01 (55730b65-3fbc-41ba-a6ab-152f5c8d71f5)
Failure      ALZ module is not correctly installed. Please install the latest version using 'Install-PSResource -Name ALZ'.
Success      powershell-yaml module is installed (version 0.4.12).

Accelerator software requirements have no been met, please review and install the missing software.
Cannot continue with Deployment...
Exception: C:\Program Files\PowerShell\Modules\ALZ\5.1.3\Private\Tools\Test-Tooling.ps1:241
Line |
 241 |          throw "Accelerator software requirements have no been met, pl …
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Accelerator software requirements have no been met, please review and install the missing software.

Changing line 165 to use cmdlet Get-Module instead of cmdlet Get-InstalledPSResource might do the trick.

$alzModuleCurrentVersion = Get-Module -Name ALZ -ListAvailable | Select-Object -Property Name, Version | Sort-Object Version -Descending | Select-Object -First 1

Ideally, I would prefer not to install the PowerShell modules on OneDrive. I install all my PowerShell modules in the C:\Program Files\PowerShell\Modules folder instead.

Debug Output/Panic Output (Optional)

Expected Behaviour (Required)

Accelerator deployment should be successful.

Actual Behaviour (Required)

Deployment failed.

Steps to Reproduce (Optional)

  1. Uninstall module ALZ.
  2. Run Install-PSResource -Name ALZ -Scope AllUsers
  3. Execute Deploy-Accelerator

Important Factoids (Optional)

No response

References (Optional)

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions