Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Usagesummary.ps1 does not properly handle [DateTime] variants for StartTime/EndTime

Đang mở
#609 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
powershell
Lĩnh vực
cloud, tooling

Hướng nghiên cứu

Bắt đầu với Usage/Usagesummary.ps1, đặc biệt là dòng 129, và tái tạo báo cáo bằng các giá trị StartTime và EndTime được cung cấp trên các phiên bản stamp lớn hơn 2002. So sánh các giá trị DateTime được truyền vào Get-AzsSubscriberUsage với lỗi ISO 8601; hoàn tất khi báo cáo sử dụng được tạo mà không gặp lỗi xác thực đó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
PowerShell
Star
260
Fork
283
Merge trung bình
2 giờ 11 phút
Pull request đã merge (30 ngày)
1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Azure/AzureStack-Tools

Tất cả issue của Azure/AzureStack-Tools

Issue tương tự

Thêm issue về Cloud

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.