0phoi5 Posted August 18, 2017 Posted August 18, 2017 Hi guys, Simple PowerShell question; If I want to copy a multi-line set of data to the clipboard, what is the best way to do it? I have the below at the moment, which successfully copies the data between the braces, however the variable $testing is literally copied as "$testing", and not as "blabla". Any better way of doing this? Thanks. $testing = "blabla" {Testing 1 Testing 2 Testing 3 $testing etc } | clip Quote
Jason Cooper Posted August 18, 2017 Posted August 18, 2017 Have you tried a here-string? $testing = "blabla" @" Testing 1 Testing 2 $testing Testing 3 "@ | clip Quote
0phoi5 Posted August 18, 2017 Author Posted August 18, 2017 2 hours ago, Jason Cooper said: Have you tried a here-string? $testing = "blabla" @" Testing 1 Testing 2 $testing Testing 3 "@ | clip Perfect, thank you! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.