azure-powershell
azure-powershell copied to clipboard
Get-AzNetappFilesPool Parameter sets (AccountObject and Name)
Description
Why can the Name parameter not be used with AccountObject parameter?
I understand the solution currently would be to separate ResourceGroupName and AccountName from the account object
or pipe into Where-Object and check for name.
but seeing as in the code it already separates the required information it would just be easier to allow name to work for both inputs, unless i'm missing something obvious
This can also be asked with Get-AzNetAppFilesVolume
Script or Debug output
No response
Environment data
No response
Module versions
Az.NetAppFiles Version 0.10.0
Error output
No response
@KlutzyBubbles , if parameter set -AccountObject
supports -Name
, information seems duplicated. If you can provide/construct AccountObject, could you explain why you still need -Name
?
@dingmeng-xue
I dont construct the AccountObject so was just wondering why the command doesnt deconstruct it to use with name instead of requiring me to deconstruct it and input it when the deconstruction already happens in the command
That is the best i can explain it, if it still doesnt make sense then there is no point continuing further
If my understanding is correct, the parameter sets are for different purposes but results should be the same. If AccountObject is available such as fetched by Get-AzNetAppFilesAccount
, user can use that object directly rather than deconstructing it to account name and rg name. But if user know its account name and resource group name, user can use Get-AzNetappFilesPool -ResourceGroupName <> -AccountName <>
directly to get the list of file pools in that account.
The deconstruction should not happen in latter case. It's the convention of Azure PowerShell module. If implementation is different or contains redundant calls, we should look into it.
If my understanding is correct, the parameter sets are for different purposes but results should be the same. If AccountObject is available such as fetched by
Get-AzNetAppFilesAccount
, user can use that object directly rather than deconstructing it to account name and rg name. But if user know its account name and resource group name, user can useGet-AzNetappFilesPool -ResourceGroupName <> -AccountName <>
directly to get the list of file pools in that account.The deconstruction should not happen in latter case. It's the convention of Azure PowerShell module. If implementation is different or contains redundant calls, we should look into it.
I re read my question and realised i forgot quite an important detail, i am only trying to get one pool in an account not all of them, which can be done by deconstructing the AccountObject and using name but not with inputting the object directly.
I got your point. There is no rule to cmdlet design for that case. But it's true it will be convenient if it supports optional parameter name
.