Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell replace double quotes with single in a string

Tags:

powershell

I just can't get it right

The below statement throws an exception and I cannot get the correct format

$appendedQry = $appendedQry -replace "\"","'"

What would be the correct syntax?

like image 703
Saksham Avatar asked Aug 26 '26 05:08

Saksham


1 Answers

It should be

$appendedQry = $appendedQry -replace '"',''''
like image 147
Saksham Avatar answered Aug 29 '26 01:08

Saksham