System.Windows.Forms.Clipboard
allows to access the clipboard. $copiedText
. add-type -assemblyName System.Windows.Forms $clipboard = [System.Windows.Forms.Clipboard]::GetDataObject() if ($Clipboard.ContainsText()) { $copiedText = $Clipboard.GetText() }