Usagesummary.ps1 does not properly handle [DateTime] variants for StartTime/EndTime
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Start with Usage/Usagesummary.ps1, especially line 129, and reproduce the report using the supplied StartTime and EndTime values on stamp versions greater than 2002. Compare the DateTime values passed to Get-AzsSubscriberUsage with the ISO 8601 error; done means the usage report generates without that validation failure.
Written by the indexing model from the issue text.
Description
Issue was reported on stamp version 2005, however the report generates on 2002 stamp properly with the same inputs.
Ask: Validate Usagesummary.ps1 on stamp versions > 2002. I have not tested this yet.
https://github.com/Azure/AzureStack-Tools/blob/master/Usage/Usagesummary.ps1
PS C:\Users\vmadmin\Documents> .\usagesummary.ps1
cmdlet usagesummary.ps1 at command pipeline position 1
Supply values for the following parameters:
StartTime: 2021-05-20
EndTime: 2021-06-01
Get-AzsSubscriberUsage : The reported date time '2021-05-20T00:00:00.0000000 00:00' is not in ISO 8601 format(YYYY-MM-DDTHH:mm:ss.sssZ).
At C:\Users\vmadmin\Documents\usagesummary.ps1:129 char:1
+ $result = Get-AzsSubscriberUsage -ReportedStartTime ("{0:yyyy-MM-ddT0 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ SubscriptionI...ationToken = }:<>f__AnonymousType0`6) [Get-AzsSubscriberUsage_List], UndeclaredResponseException
+ FullyQualifiedErrorId : BadRequest,Microsoft.Azure.PowerShell.Cmdlets.CommerceAdmin.Cmdlets.GetAzsSubscriberUsage_List
Switching line 129 to this and it works:
$result = Get-AzsSubscriberUsage -ReportedStartTime $StartTime -ReportedEndTime $EndTime -AggregationGranularity $Granularity
- Dominant language
- PowerShell
- Stars
- 260
- Forks
- 283
- Avg merge
- 2h 11m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/AzureStack-Tools
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
Azure/AzureStack-Tools#710 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
Azure/AzureStack-Tools#707 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
Azure/AzureStack-Tools#705 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
Azure/AzureStack-Tools#680 ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
Azure/AzureStack-Tools#648 · 1 comment ·
All issues in Azure/AzureStack-Tools
Similar issues
-
documentation improve or update documentation priority/low triage
Difficulty 2/5 Half a day Newbie friendliness 86/100
warpdotdev/docs#782 · 1 comment ·
-
Product: Azure Policy :shield: Topic: Diagnostic Settings :test_tube: Topic: Policy :pencil:
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
Azure/Azure-Landing-Zones#4283 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
google-gemma/gemma-skills#11 ·
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100