In PowerShell I have the following string that I read from file and need to convert to json:
"@{Account='User01';Domain='Domain01';Admin='True'}"
In my PS script I try to do this (simplified):
$myStr = "@{Account='User01';Domain='Domain01';Admin='True'}" | ConvertTo-Json
$mystr
the result of myStr is:
"@{Account=\u0027User01\u0027;Domain=\u0027Domain01\u0027;Admin=\u0027True\u0027}"
and not a json I can use. note that the @ sign at the beginning of the string is what I get from the file.
How can I convert it to an object I can use?