字符串中缺少转义符:
"full_path_to_requestrouter_amd64_msi": "c:\script_downloads\\requestrouter.msi",
刚刚
c:
. 这应该是
c:\\script
.
一旦你解决了这个问题,它就会起作用:
$json = @"
{
"region": "US",
"proxy_address_exception_list": "1.1.1.1; 2.2.2.2",
"dsvm_ip_address": "10.1.1.1",
"svm_ip_address": "10.2.2.2",
"url_without_xto": "abc.com",
"url_with_xto": "def-xto.com",
"web_server_farm_name": "dss",
"full_path_to_requestrouter_amd64_msi": "c:\\script_downloads\\requestrouter.msi",
"full_path_to_rewrite_amd64_en_US_msi": "c:\\script_downloads\\rewrite.msi",
"full_path_to_webfarm_v1_1_amd64_en_US_msi" : "c:\\script_downloads\\webfarm.msi",
"full_path_to_application_host_config": "c:\\script_downloads\\applicationHost.config"
}
"@
$x = $json | ConvertFrom-Json
$x
region : US
proxy_address_exception_list : 1.1.1.1; 2.2.2.2
dsvm_ip_address : 10.1.1.1
svm_ip_address : 10.2.2.2
url_without_xto : abc.com
url_with_xto : def-xto.com
web_server_farm_name : dss
full_path_to_requestrouter_amd64_msi : c:\script_downloads\requestrouter.msi
full_path_to_rewrite_amd64_en_US_msi : c:\script_downloads\rewrite.msi
full_path_to_webfarm_v1_1_amd64_en_US_msi : c:\script_downloads\webfarm.msi
full_path_to_application_host_config : c:\script_downloads\applicationHost.config