Closed RTTrickster closed 3 years ago
Update: Just realised this is also true of the variable $User.UserPrincipalName which represents string 'User@domain.com'.
So, no special characters allowed in property fields. Is this a bug? Have I missed some documentation?
My apologies, I was chasing the wrong thing. I assumed my issue was with special characters in the property value, it was actually the fact that I had a space in the column name. After removing the space in the column name, the property value writes no problem.
I have a variable for an AD user account that contains the property of $User.DistinguishedName, representing a string equivalent to ' CN=username,OU=User OU,DC=MyDomain,DC=com '.
When attempting to write this value to a Table row using the standard code;
Add-azTableRow -table $table -partitionKey $partitionKey -rowKey ([guid]::NewGuid().tostring()) -property @{ 'Distinguished Name' = $User.DistinguishedName }
I am presented with the error:
If I repeat the same command with a different plain text value from the same variable, such as $User.name, it works perfectly fine.
I reviewed https://docs.microsoft.com/en-us/rest/api/storageservices/Understanding-the-Table-Service-Data-Model?redirectedfrom=MSDN but there is no mention of disallowed characters in the property values.