Fix error message templates for some field names (#8321)

some fields may start with a "u" character which causes
Powershell to think it is a unicode escape sequence.
This commit is contained in:
Dor Dadush
2021-01-07 03:58:58 -05:00
committed by GitHub
parent 367ba3a2cf
commit c67dc5d7d5
2 changed files with 5 additions and 5 deletions

View File

@@ -120,17 +120,17 @@ function ConvertFrom-PSJsonToPet {
}
If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json
throw "Error! Empty JSON cannot be serialized due to the required property `name` missing."
throw "Error! Empty JSON cannot be serialized due to the required property 'name' missing."
}
if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) {
throw "Error! JSON cannot be serialized due to the required property `name` missing."
throw "Error! JSON cannot be serialized due to the required property 'name' missing."
} else {
$Name = $JsonParameters.PSobject.Properties["name"].value
}
if (!([bool]($JsonParameters.PSobject.Properties.name -match "photoUrls"))) {
throw "Error! JSON cannot be serialized due to the required property `photoUrls` missing."
throw "Error! JSON cannot be serialized due to the required property 'photoUrls' missing."
} else {
$PhotoUrls = $JsonParameters.PSobject.Properties["photoUrls"].value
}