PowerShell / PowerShell/PowerShell

Add support for extension methods (LINQ)

オープン
#2,226 コメント 42 件 リアクション 43 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Committee-Reviewed Issue-Enhancement KeepOpen WG-Language WG-NeedsReview
主要言語
C#
スター
55.5k
フォーク
8.5k
平均マージ
1日 2時間
マージ済み PR(30日)
88

説明

Copied from TFS item 819298

Original Connect item: https://connect.microsoft.com/PowerShell/feedback/details/635454/add-support-for-linq

When LINQ is available, it can push queries into the native language of the underlying storage without requiring users to learn that query language. This transformation can speed up queries to perform hundreds times faster, and when the alternative is to ship large amounts of data over the wire to be filtered locally, thousands of times faster.

In many cases using LINQ can convert a script which ran so slow as to be infeasible into scripts that we can run every day, and in fact, can run whenever we like -- and it also drastically reduces CPU impact.

For a trivial example, see this post on Stack Overflow http://stackoverflow.com/questions/4559233/technique-for-selectively-formatting-data-in-a-powershell-pipeline-and-output-as where the switch to using LINQ (by embedded the LINQ into a C# function via Add-Type and calling it from PowerShell) provided 1000 times speedup. It's currently not possible to write that LINQ query at all in pure PowerShell, and the alternative (as it was written in the other answer on that StackOverflow question, using Where-Object) is extremely slow even on modest data sets.

The bottom line is that the Where-Object and Select-Object cmdlets are very slow, and using them to query databases, and other remote systems results in not only the slowdown of processing thousands of items in a Where-Object, but potentially sending them all over the wire as well.

Since LINQ to events is becoming available through the Rx project, it's more useful, and more important than ever, and we really need a way to write LINQ natively in PowerShell.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

issue には実装ファイル、テスト、エントリポイントが記載されていません。まずリンクされた Connect 項目と Stack Overflow の例を確認し、その後、PowerShell におけるネイティブ LINQ および extension-method サポートの意図された範囲を判断してください。完了とみなすには、合意された設計と、要求されたクエリシナリオに対する動作するサポートが必要であり、テストがその設計の一部として特定されている必要があります。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp, powershell
領域
cli, compilers
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。