Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Examples for comparison operators -contains and -in contain errors

オープン 初心者向け
#13,324 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
85/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
markdown
領域
documentation

調査の方向性

例は reference/7.6/Microsoft.PowerShell.Core/About/about_Comparison_Operators.md の包含演算子のセクションにあり、-contains と -in の両方について書かれています。PowerShell セッションでスニペットを実行し、最後から2番目の例が $a が展開されたときにのみ True を出力することを確認してください。これには二重引用符が必要です。完了条件は、その例の -contains と -in の両ブロックで二重引用符を使い、出力が引き続き一致することです。

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

説明

issue-doc-bug up-for-grabs
Type of issue

Code doesn't work

Feedback

-contains has a box with this example code:

$a = 'abc', 'def'
'abc', 'def', 'ghi' -contains $a # Output: False

# The following statements are equivalent
$a, 'ghi' -contains $a           # Output: True
'$a', 'ghi' -contains $a         # Output: True
'abc def', 'ghi' -contains $a    # Output: True

But the second last example is wrong, $a is not expanded in single quotes, should probably be:

"$a", 'ghi' -contains $a         # Output: True

-in has an identical example with the same issue.

Page URL

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comparison_operators?view=powershell-7.6#containment-operators

Content source URL

https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/7.6/Microsoft.PowerShell.Core/About/about_Comparison_Operators.md

Author

@sdwheeler

Platform Id

80f0a95a-9d5c-b1f1-59ea-8a2e59025a82

Document Id

742e7d8c-b6bc-6939-3e9d-b25bcc14dfed

主要言語
PowerShell
スター
2.6k
フォーク
1.7k
平均マージ
4時間 11分
マージ済み PR(30日)
8

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

MicrosoftDocs/PowerShell-Docs のほかの issue

MicrosoftDocs/PowerShell-Docs の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

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

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