While fetching data from db, I am getting a string which is not getting formatted in pwoershell.
String
[{"varun":"\\","rocks":true}]
It throws below exception System.FormatException: Input string was not in a correct format.
My guess is that you're using it with the -f operator as format string? In this case you'll have to escape { and } as {{ and }} respectively because those are used for placeholders in the format string (e.g. {0}).
Also please provide more details next time, such as the complete error message (it says where it occurs, for example) and the code where it happens.
Convert-FromJson. Can you show us relevant part the script which give the error?