Powershell: Extra blank lines in pipeline to CLIP command?
I'm trying to get a file path and place it into the clipboard using Powershell. Below is what I have, and while it likely could be optimized, it seems to be finding a single file path as I desire. But the output that ends up in the clipboard includes some extra blank lines above and below the actual file path I want. I've tried a number of ways to try and remove these with no success, so looking for help.
For background I'm trying to query the Windows recently used files and pull out the single most recent one that was for a *.pdf or *.png file. That logic seems to be working (feel free to suggest improvements), but the problem is the result file path has blank lines above and below in the clipboard after this runs.
I may be mixing up objects and strings (still rooted in a DOS CMD background) or maybe there is something else involved.
»bp