-
Notifications
You must be signed in to change notification settings - Fork 4k
Adding Virtual Network Usage cmdlet #4159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@EvgenyAgafonchikov, |
Mandatory = true, | ||
ValueFromPipelineByPropertyName = true)] | ||
[ValidateNotNullOrEmpty] | ||
public string Name { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EvgenyAgafonchikov what does Name parameter mean here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name
is name of the Virtual Network to perform operation on. Added help messages to avoid confusion.
@@ -35,6 +35,8 @@ The Add-AzureRmRouteFilterRuleConfig cmdlet adds a route filter rule to an Azure | |||
|
|||
|
|||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EvgenyAgafonchikov remove extra line breaks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shahabhijeet, *.md files line breaks are added during the process of help autogeneration. Could you please clarify, should I manually update autogenerated files or keep them as is in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EvgenyAgafonchikov platyPS
will sometimes add these blank lines (I haven't determined why yet), so you can go ahead and revert the changes that add unnecessary lines that are autogenerated.
``` | ||
PS C:\> Get-AzureRmVirtualNetworkUsageList -ResourceGroupName test -Name usagetest | ||
|
||
Get-AzureRmVirtualNetworkUsageList -ResourceGroupName test -Name usagetest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EvgenyAgafonchikov can you provide an example of how to use this particular cmdlet when a list if returned
Give a full example something along the line of
$vNetUsageList = Get-AzureRmVirtualNetworkUsageList -ResourceGroupName test -Name usagetest
Because the name has the noun list, but all you are doing is returning 1 PSVirtualNetworkUsage rather the expectation is it should return IEnumerable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated cmdlet to return List<PSVirtualNetworkUsage>
explicitly.
The example output sample contains list of two PSVirtualNetworkUsage
items now
6b00118
to
190e20e
Compare
e6b049c
to
012f5c7
Compare
012f5c7
to
bfc8381
Compare
HelpMessage = "The resource group name.")] | ||
[ValidateNotNullOrEmpty] | ||
public string ResourceGroupName { get; set; } | ||
[Parameter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EvgenyAgafonchikov nit: can we put a blank line between the two parameters?
{ | ||
public partial class PSVirtualNetworkUsage | ||
{ | ||
public string Id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EvgenyAgafonchikov nit: for each of these properties, can we add the get
and set
methods to be consistent with the other model classes?
public string Id { get; set; }
var vVirtualNetworkModel = Mapper.Map<CNM.PSVirtualNetworkUsage>(vVirtualNetwork); | ||
vnetUsageList.Add(vVirtualNetworkModel); | ||
} | ||
WriteObject(vnetUsageList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EvgenyAgafonchikov this should be WriteObject(vnetUsageList, true)
(which sets the enumerateCollection
parameter to true) so that the list you have constructed writes each object to the output stream rather than writes the array as a whole object to the stream
@@ -35,6 +35,8 @@ The Add-AzureRmRouteFilterRuleConfig cmdlet adds a route filter rule to an Azure | |||
|
|||
|
|||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EvgenyAgafonchikov platyPS
will sometimes add these blank lines (I haven't determined why yet), so you can go ahead and revert the changes that add unnecessary lines that are autogenerated.
@@ -37,6 +37,8 @@ The Get-AzureRmApplicationGatewayBackendHealth cmdlet gets application gateway b | |||
|
|||
|
|||
|
|||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EvgenyAgafonchikov same comment about removing the extra blank lines in this file
@@ -38,6 +38,8 @@ The Test-AzureRmNetworkWatcherConnectivity cmdlet returns connectivity informati | |||
|
|||
|
|||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EvgenyAgafonchikov same comment about removing the blank lines in this file
@cormacpayne , I've processed recent comments, please have a look once CI pass |
@EvgenyAgafonchikov looks good, should be good to go, once all @cormacpayne feedback is addressed. |
Description
This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.
General Guidelines
Testing Guidelines
Cmdlet Signature Guidelines
ShouldProcess
and haveSupportShouldProcess=true
specified in the cmdlet attribute. You can find more information onShouldProcess
here.OutputType
attribute if any output is produced - if the cmdlet produces no output, it should implement aPassThru
parameter.Cmdlet Parameter Guidelines