PowerShell / PowerShell/PSScriptAnalyzer
What would be the correct TargetProfile for Ubuntu 20.04 runnin PSCore 7.1.3?
還沒有人認領這個 Issue。
- 主要語言
- C#
- 星號
- 2.2k
- 分支
- 415
- 平均合併
- 13 小時 1 分鐘
- 30 天內合併 PR
- 2
描述
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.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 RuleDocumentation/UseCompatibleCommands.md 以及其中引用的 PSCompatibilityCollector 文件開始。驗證 Ubuntu 和 PowerShell 範例的 TargetProfiles 語法及版本需求,然後記錄這些值,並釐清無效設定檔是遭到拒絕還是被忽略。文件能夠回答範例中的問題並解釋格式錯誤的設定檔行為,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- powershell
- 領域
- documentation, tooling
- Issue 類型
- 文件
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100