Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

adding single quotes to string

$
0
0

I can add a comma to the end of a string

$content = Get-Content "C:\Temp\reboot\list.txt"

$content | Foreach-Object{ "{0}{1}" -f $_,', ' } | Set-Content "C:\Temp\reboot\listdone.txt"

but how would I wrap my string in single quotes?  I need to add a leading single quote and a trailing single quote.

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles