Jump to content

[PowerShell] Best way to copy multiple lines including variables?


Recommended Posts

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

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...