Probably now is not the best time to upgrade your PowerShell to 7.3

Jiadong Chen
2 min readNov 16, 2022
Photo by Max Duzij on Unsplash

About 5 or 6 days ago, while executing a PowerShell script that had been working fine, I ran into an error I hadn’t seen before.

Get-Az***: GenericArguments[0], 'Microsoft.Azure.****', on 'T MaxIntegerT' violates the constraint of type 'T'.

Recalling carefully, I did not modify the script at the time, the only thing I did was to upgrade the version of PowerShell.

After that, I searched for similar issues in the azure-powershell Github repository, and the results I found were not good. According to the developers:

We are looking into problem. Besides Az.Compute, Az.Network has the same problem. I believe some popular modules have the same problem. Please use PowerShell 7.2 or lower for the time being.

So, if you asked me 5 days ago whether to upgrade powershell to 7.3, I would definitely tell you not to.

I believe the developers must be fixing this issue these days, and some release candidates have been released, but according to the developers,

our scenario test coverage rate is about 70% and cannot cover all 2000+ Azure resources. If you hit the issue, please share to us.

so there still seems to be some risk in using PowerShell 7.3. If you ask me whether to upgrade PowerShell to 7.3 now, I would tell you probably now is not the best time to upgrade your PowerShell to 7.3.

So how did I solve this problem in my case? It’s actually very simple, I just downgraded the version of PowerShell from 7.3 to 7.2.7

Jiadong Chen

Microsoft MVP, MCT | Azure Certified Solutions Architect & Cybersecurity Architect Expert | Member of .NET Foundation | Packt Author