Azure / autorest.powershell

AutoRest PowerShell Generator
MIT License
112 stars 77 forks source link

Error message of cmdlet is vague when context is empty #793

Open dingmeng-xue opened 3 years ago

dingmeng-xue commented 3 years ago

When current AzContext is empty or user hasn't logged in, the error message of autogen based cmdlet is vague to end user.

PS C:\> Get-AzContext
PS C:\> Get-AzMapsAccount
Get-AzMapsAccount_List1: C:\Users\Documents\PowerShell\Modules\Az.Maps\0.8.0\exports\ProxyCmdletDefinitions.ps1:310
Line |
 310 |          $scriptCmd = {& $wrappedCmd @PSBoundParameters}
     |                                      ~~~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'SubscriptionId' because it is null.
isolenov commented 2 years ago

This error message is quite confusing for those who unfamiliar with Az PowerShell.