Houman
Houman

Reputation: 66390

How do I escape a mixture of " and ' in Powershell?

/[Path='/'].applicationPool:"ASP.NET v4.0"

This whole line is actually a parameter, so I would like to put single quotes around it. But it doesn't work because it already includes single quotes.

I have tried the ` in front of the single quoates without success.

Any suggestions?

Upvotes: 2

Views: 82

Answers (2)

Shay Levy
Shay Levy

Reputation: 126912

Another way would be to double each nested single quote:

'/[Path=''/''].applicationPool:"ASP.NET v4.0"'

Upvotes: 0

manojlds
manojlds

Reputation: 301527

You have to surround with quotes and escape the inner quotes with backtick:

"/[Path='/'].applicationPool:`"ASP.NET v4.0`""

Upvotes: 3

Related Questions