0

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.

1
  • That looks like JSON. I'm assuming you're passing this to Convert-FromJson. Can you show us relevant part the script which give the error? Commented Jul 4, 2013 at 13:46

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Joey for help, I'll make sure to provide more info from next time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.