Document the Get-Clipboard verbose message when the system clipboard is unavailable

Đang mở Phù hợp với người mới
#13,431 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
powershell
Lĩnh vực
documentation

Hướng nghiên cứu

Đọc reference/7.7/Microsoft.PowerShell.Management/Get-Clipboard.md và kiểm tra cách tài liệu mô tả hành vi theo nền tảng và đầu ra chi tiết. Thêm ghi chú giải thích rằng khi bảng tạm của hệ thống không khả dụng, Get-Clipboard sẽ dùng bảng tạm nội bộ của PowerShell, vốn chỉ được điền bằng Set-Clipboard, và -Verbose sẽ báo về việc dùng phương án dự phòng này. Hoàn tất khi bài viết mô tả hành vi này và đầu ra mặc định vẫn rõ ràng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Prerequisites

  • Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
  • Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Document new Get-Foo cmdlet" instead of "New cmdlet."

Summary

Document the new verbose message that Get-Clipboard emits when it can't access the system clipboard and falls back to PowerShell's internal clipboard.

On Linux and macOS, Get-Clipboard reads the system clipboard through xclip or pbpaste. On unsupported platforms, or when that tool isn't installed, the cmdlet silently falls back to PowerShell's internal clipboard, which only Set-Clipboard populates. Users then see content that doesn't match their desktop clipboard, or no content at all, with no explanation.

PowerShell/PowerShell#26838 changes this so the fallback is reported on the verbose stream:

Get-Clipboard -Verbose
VERBOSE: The system clipboard is not available. Get-Clipboard falls back to PowerShell's internal clipboard, which is populated only by Set-Clipboard.

Default output is unchanged; the message only appears with -Verbose.

Details

  • The message is written with WriteVerbose, so it does not affect the success output stream or non-verbose runs. This keeps backward compatibility for scripts and for environments that intentionally run without a clipboard tool.
  • Windows behavior is unchanged; the fallback path only exists on Unix and on unsupported platforms.
  • Suggested documentation: a note in the Get-Clipboard article explaining the internal-clipboard fallback and how -Verbose reveals it. Mentioning Set-Clipboard as the only way to populate the internal clipboard would help users understand the behavior.

Articles

  • reference/7.7/Microsoft.PowerShell.Management/Get-Clipboard.md

Related Source Pull Requests

Related Source Issues

  • PowerShell/PowerShell#26838
Ngôn ngữ chính
PowerShell
Star
2.6k
Fork
1.7k
Merge trung bình
3 giờ 49 phút
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của MicrosoftDocs/PowerShell-Docs

Tất cả issue của MicrosoftDocs/PowerShell-Docs

Issue tương tự

Thêm issue về Documentation

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.