Skip to content

Commit 2bf9e8e

Browse files
committed
Updated code based on pull request feedback
1 parent 11a805b commit 2bf9e8e

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/ResourceManager/Commerce/Commands.UsageAggregates.Test/ScenarioTests/UsageAggregatesTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616

1717
namespace Microsoft.Azure.Commands.UsageAggregates.Test.ScenarioTests
1818
{
19-
2019
public class UsageAggregatesTests
2120
{
22-
2321
[Fact]
2422
public void TestGetUsageAggregatesWithDefaultParameters()
2523
{

src/ResourceManager/Commerce/Commands.UsageAggregates/GetUsageAggregatesCommand.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ namespace Microsoft.Azure.Commands.UsageAggregates
2727
[Cmdlet(VerbsCommon.Get, "UsageAggregates"), OutputType(typeof(UsageAggregationGetResponse))]
2828
public class GetUsageAggregatesCommand : AzurePSCmdlet
2929
{
30+
private UsageAggregationManagementClient _theClient;
31+
3032
[Parameter(Mandatory = true, HelpMessage = "The start of the time range to retrieve data for.")]
3133
public DateTime ReportedStartTime { get; set; }
3234

@@ -50,16 +52,15 @@ public bool ShowDetails {
5052
[Parameter(Mandatory = false, HelpMessage = "Retrieved from previous calls, this is the bookmark used for progress when the responses are paged.")]
5153
public string ContinuationToken { get; set; }
5254

53-
private UsageAggregationManagementClient theClient;
5455
public override void ExecuteCmdlet()
5556
{
56-
if (theClient == null)
57+
if (_theClient == null)
5758
{
58-
theClient = AzureSession.ClientFactory.CreateClient<UsageAggregationManagementClient>(Profile,
59+
_theClient = AzureSession.ClientFactory.CreateClient<UsageAggregationManagementClient>(Profile,
5960
Profile.Context.Subscription, AzureEnvironment.Endpoint.ResourceManager);
6061
}
6162

62-
UsageAggregationGetResponse aggregations = theClient.UsageAggregates.Get(ReportedStartTime,
63+
UsageAggregationGetResponse aggregations = _theClient.UsageAggregates.Get(ReportedStartTime,
6364
ReportedEndTime, AggregationGranularity, ShowDetails,
6465
ContinuationToken);
6566

src/ResourceManager/Commerce/Commands.UsageAggregates/TestTheCmdLet.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
$subscription = <Add subscription ID>
1+
# sample script to help the developer verify changes using PowerShell and importing the dll.
2+
$subscription = "<Add subscription ID>"
23

3-
Import-Module C:\GitHub\MyGitHub\azure-powershell\src\Package\Debug\ResourceManager\AzureResourceManager\UsageAggregates\Microsoft.Azure.Commands.UsageAggregates.dll
4+
Import-Module "<path to>"Microsoft.Azure.Commands.UsageAggregates.dll
45

56
Add-AzureAccount
67

src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ NestedModules = @(
9999
'.\ApiManagement\Microsoft.Azure.Commands.ApiManagement.dll',
100100
'.\StorageManagement\Microsoft.Azure.Commands.Management.Storage.dll',
101101
'.\OperationalInsights\Microsoft.Azure.Commands.OperationalInsights.dll',
102-
'.\UsageAggregates\Microsoft.Azure.Commands.UsageAggregates.dll'
102+
'.\UsageAggregates\Microsoft.Azure.Commands.UsageAggregates.dll'
103103
)
104104

105105
# Functions to export from this module

0 commit comments

Comments
 (0)