convertto-json

ConvertTo-Json and ConvertFrom-Jason with special characters

℡╲_俬逩灬. 提交于 2019-12-21 14:38:28
问题 I have a file containing some properties which value of some of them contains escape characters, for example some Urls and Regex patterns. When reading the content and converting back to the json, with or without unescaping, the content is not correct. If I convert back to json with unescaping, some regular expression break, if I convert with unescaping, urls and some regular expressions will break. How can I solve the problem? Minimal Complete Verifiable Example Here are some simple code

Unexpected ConvertTo-Json results? Answer: it has a default -Depth of 2

一曲冷凌霜 提交于 2019-11-26 19:11:41
Why do I get unexpected ConvertTo-Json results? And why does a round-trip ( $Json | ConvertFrom-Json | ConvertTo-Json ) fail? Meta issue Stackoverflow has a good mechanism to prevent duplicate questions but as far as I can see there is no mechanism to prevent questions that have a duplicate cause . Take this question as a an example: almost every week a new question comes in with the same cause, yet it is often difficult to define it as a duplicate because the question itself is just a slightly different. Nevertheless, I wouldn't be surprised if this question/answer itself ends up as a

Unexpected ConvertTo-Json results? Answer: it has a default -Depth of 2

﹥>﹥吖頭↗ 提交于 2019-11-26 03:59:55
问题 Why do I get unexpected ConvertTo-Json results? And why does a round-trip ( $Json | ConvertFrom-Json | ConvertTo-Json ) fail? Meta issue Stackoverflow has a good mechanism to prevent duplicate questions but as far as I can see there is no mechanism to prevent questions that have a duplicate cause . Take this question as a an example: almost every week a new question comes in with the same cause, yet it is often difficult to define it as a duplicate because the question itself is just a