Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

How to remove quotes from cmd echoing into a file?

$
0
0

Hi Guys,

This is probably a very easy one for you, but I just want to remove the quotes before it gets put into a file.

To cut a story short – the code is below.

echo “$body = (gc Backup.txt | out-string)” >> %temp%email.ps1

email.ps1 when opened is “$body = (gc Backup.txt | out-string)” but this obviously doesn’t work in Powershell as it needs to have the quotation removed.

Could you please advise?

submitted by /u/zommy
[link] [comments]

The post How to remove quotes from cmd echoing into a file? appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Trending Articles