Computer Operator

PowerShell trick with single quotes

I was discussing the use of single quotes with a colleague, Daniel Ratliff, and how to have a single quote show up in a string delimited by single quotes.I was so happy because I use a method he wasn’t aware of, just putting in two, single, quotes. So, if I want to see:

That’s amazing!

I could put:

Write-Host ‘That”s amazing!’

There are definitely other ways to do this, but we didn’t see this method mentioned anywhere. I’ve been using this for a while and have had no issues.