Azure / Azure/azure-powershell

Install-AzModule & Update-AzModule Report Errors when Specifiy RequiredAzVersion

Open
#23,826 0 comments 0 reactions 1 assignee Claimed by @msJinLei View on GitHub
Az.Tools.Installer bug Tracking
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

When specify `RequiredAzVersion` to `11.0`, `11.1` of Install-AzModule or Update-AzModule, the cmdlet will report an error.
The issue can be steadily reported across the different platform.

### Issue script & Debug output

```PowerShell
PS /home/root> Install-AzModule -RequiredAzVersion $lastMajorVersion -Repository PSGallery -UseExactAccountVersion -RemovePrevious -RemoveAzureRm -Debug
DEBUG: Powershell Core Version 7.3.6
Install-AzModule: The property 'RequiredVersion' cannot be found on this object. Verify that the property exists.
DEBUG: Finish sending metric
Exception: /home/root/.local/share/powershell/Modules/Az.Tools.Installer/1.0.0/internal/Install-AzModule_Default.ps1:82
Line |
82 | $modules += Get-AzModuleFromRemote @findModuleParams | Sort-O …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The property 'RequiredVersion' cannot be found on this object. Verify that the property exists.
```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 7.3.6
PSEdition Core
GitCommitId 7.3.6
OS Linux 5.4.0-1104-azure #110~18.04.1-Ubuntu SMP Sat Feb 11 17:41:21 UTC 2023
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```

### Module versions

```PowerShell
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 1.0.0 Az.Tools.Installer {Install-AzModule, Uninstall-AzModule, Update-AzModule}
```

### Error output

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.