I am not strong in PowerShell. Previous script sends data from clipboard ONLY to console, it doesn't send them to STDOUT and such script cannot be used to pipe data to other commands. This is version of script that really sends data from clipbaord to the stdout:
```
# scb is alias for Set-Clipboard
# gcb is alias for Get-Clipboard
# sleep is alias for Start-Sleep
# copy data from clipboard to stdout
Set-Clipboard # clear clipboard
while ($true) {
$TXT = Get-Clipboard # read clipboard
if ($TXT) {
Write-Output "$TXT"
Set-Clipboard # clear clipboard
}
else {
Start-Sleep -Milliseconds 100 # sleep 100ms
}
}
```
I am not strong in PowerShell. Previous script sends data from clipboard ONLY to console, it doesn't send them to STDOUT and such script cannot be used to pipe data to other commands. This is version of script that really sends data from clipbaord to the stdout:
```
# scb is alias for Set-Clipboard
# gcb is alias for Get-Clipboard
# sleep is alias for Start-Sleep
# copy data from clipboard to stdout
Set-Clipboard # clear clipboard
while ($true) {
$TXT = Get-Clipboard # read clipboard
if ($TXT) {
Write-Output "$TXT"
Set-Clipboard # clear clipboard
}
else {
Start-Sleep -Milliseconds 100 # sleep 100ms
}
}
```