The most annoying bug ever in PowerShell v3 (on Windows 8):
$ht = @{ name = "single quotes (') are fine"; value = 'double quotes (") are not' }
$ht | convertto-json
ConvertTo-Json : The converted JSON string is in bad format.
At line:1 char:7
+ $ht | convertto-json
+ ~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Collections.Hashtable:PSObject) [ConvertTo-Json], InvalidOperationException
+ FullyQualifiedErrorId : JsonStringInBadFormat,Microsoft.PowerShell.Commands.ConvertToJsonCommand
A belated thank you to Jason Stangroome (@jstangroome) who posted this to Microsoft Connect (I must admit this slipped my mind the way it broke the code I was using). Surely they'd have unit tests for things like a JSON parser?
@solevangelist I was able to reproduce this so I've logged the bug on MS Connect. You can vote it up here: connect.microsoft.com/PowerShell/fee?
— Jason Stangroome (@jstangroome) April 9, 2012