PowerShell / PowerShell/PSScriptAnalyzer

Install-Module for PSScriptAnalyzer Occasionally failing for version 1.23.0

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

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

Ngôn ngữ chính
C#
Star
2.2k
Fork
414
Merge trung bình
13 giờ 1 phút
Pull request đã merge (30 ngày)
2

Mô tả

Steps to reproduce

Run the command

Install-Module -Name PSScriptAnalyzer -RequiredVersion 1.23.0 -Force -Scope CurrentUser

Expected behavior

The PSScriptAnalyzer module should install without issue.

Actual behavior

Occasionally I'm hitting the following exception (occurs roughly 1 out of every 20 times):

WARNING: Source Location 
'https://www.powershellgallery.com/api/v2/package/PSScriptAnalyzer/1.23.0' is 
not valid.
PackageManagement\Install-Package : Package 'PSScriptAnalyzer' failed to 
download.
At C:\Program 
Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 
char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (C:\Users\Contai...tAnalyze 
   r.nupkg:String) [Install-Package], Exception
    + FullyQualifiedErrorId : PackageFailedInstallOrDownload,Microsoft.PowerSh 
   ell.PackageManagement.Cmdlets.InstallPackage

If an unexpected error was thrown then please report the full error details using e.g. $error[0] | Select-Object *

Environment data

> $PSVersionTable

TBD - need to get this info injected into our build pipeline where we're seeing this issue (not really an issue seen locally)

> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }

N/A (module hasn't been installed yet)

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.

Hướng nghiên cứu

Bắt đầu bằng cách chạy lặp lại lệnh PowerShell Install-Module đã được báo cáo cho PSScriptAnalyzer 1.23.0, sau đó thu thập dữ liệu $PSVersionTable còn thiếu và toàn bộ chi tiết lỗi. So sánh các lần thử thành công và thất bại để xác định liệu lỗi tải xuống không ổn định từ PowerShell Gallery có thể tái hiện hay không; hoàn tất khi xác định được nguyên nhân đáng tin cậy và xác minh được kết quả cài đặt.

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

Đánh giá

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

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.