PowerShell / PowerShell/PSScriptAnalyzer
What would be the correct TargetProfile for Ubuntu 20.04 runnin PSCore 7.1.3?
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ả
Reading the UseCompatibleCommands documentation, it says the TargetProfiles should follow the syntax:
<os-name>_<os-arch>_<os-version>_<ps-version>_<ps-arch>_<dotnet-version>_<dotnet-edition>
But it falls short on explaining how to get these values.
So, after a little bit of detective work and figuring out which framework version each PowerShell ships with, I come up with the following string:
ubuntu_x64_20.04_7.1.3_x64_5.0.220.61302_core
The most painful to figure out is the 5.0.220.61302 part which I assume is the dotnet-version PowerShell 7.1.3 ships with. Or does it matter?
Especially figuring out the build number is painful because the documentation on the referenced page don't go to explain if 5.0.2 is good enough or should I use the full version 5.0.220.61302.
It's not at all helpful that if I put 'dos_arm_6.1_9.9.9_x64_9999999999_goosfraba' into TargetProfiles, the Invoke-ScriptAnalyzer just merrily goes forward as if nothing happened.
- Is
ubuntu_x64_20.04_7.1.3_x64_5.0.220.61302_coregood for PSCore 7.1.3 running under Ubuntu 20.04? - Could you update the docs when new version of PowerShell is released? It could prove useful if my case was already in the docs so I could just copy/paste it.
- Would it at all be possible if
Invoke-ScriptAnalyzerwould produce at least a warning message when a profile string like'dos_arm_6.1_9.9.9_x64_9999999999_goosfraba'is passed to it?
Yes, the documentation says I could use PSCompatibilityCollector but when I go there, there's 0 documentation.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với RuleDocumentation/UseCompatibleCommands.md và tài liệu PSCompatibilityCollector được tham chiếu trong đó. Xác minh cú pháp của TargetProfiles và các yêu cầu về phiên bản cho ví dụ Ubuntu và PowerShell, sau đó ghi lại các giá trị và làm rõ liệu các profile không hợp lệ bị từ chối hay bị bỏ qua. Công việc được xem là hoàn tất khi tài liệu trả lời các câu hỏi trong ví dụ và giải thích hành vi đối với các profile sai định dạng.
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
- documentation, tooling
- Loại issue
- Tài liệu
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100