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

Aperta Adatta ai principianti
#13,431 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
powershell
Ambito
documentation

Direzione di ricerca

Leggi reference/7.7/Microsoft.PowerShell.Management/Get-Clipboard.md e controlla come vengono documentati il comportamento della piattaforma e l'output dettagliato. Aggiungi una nota che spieghi che, quando gli appunti di sistema non sono disponibili, Get-Clipboard usa gli appunti interni di PowerShell, popolati solo da Set-Clipboard, e che -Verbose segnala questo ripiego. Il lavoro è concluso quando l'articolo descrive questo comportamento e l'output predefinito resta chiaro.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
PowerShell
Stelle
2.6k
Fork
1.7k
Merge medio
3h 49m
PR unite (30g)
5

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MicrosoftDocs/PowerShell-Docs

Tutte le issue di MicrosoftDocs/PowerShell-Docs

Issue simili

Altre issue su Documentation

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.