PowerShell / PowerShell/PSScriptAnalyzer
Check for platform-dependent path usage
まだ誰も着手していません。
- 主要言語
- C#
- スター
- 2.2k
- フォーク
- 414
- 平均マージ
- 13時間 1分
- マージ済み PR(30日)
- 2
説明
As suggested by @SteveL-MSFT.
A rule that checks/corrects filesystem path usage that doesn't translate across between Windows and UNIX-like OSes could ease migration to PowerShell Core.
User story
As a PowerShell user, I want a rule to tell me when a path I've used
will break my script on another platform, so that I can write
cross-platform scripts more easily (e.g. for Azure scenarios).
Proposed technical implementation
Check all *-*Item and *-Path cmdlets (and their aliases) for direct string/bareword arguments to check for platform specific usages (like C:), or even encourage usage of Join-Path or [System.IO.Path]::Combine() instead of / and \.
Of course this check isn't universally feasible, but this is another case where some constant folding would come in handy for PowerShell analysis (something PSES could also use).
Latest current version of PSSA
1.17.1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
この issue では、ファイル、テスト、既存のルール エントリ ポイントが指定されていません。まず、PSScriptAnalyzer がルールをどのように実装し、*-Item および *-Path cmdlet とエイリアスをどのように識別しているかを確認してください。実装する前に、サポートするプラットフォーム固有のパターンと constant-folding の範囲を定義してください。完了とは、ルールが合意されたケースを検出し、サポートされている場合は修正でき、テストも備わっていることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- csharp, powershell
- 領域
- tooling
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100