Skip to content

How to use Invoke-VenafiRestMethod to update custom field #91

Answered by gdbarron
tonyb2BB asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @tonyb2BB, you were close, but I see 2 issues. The first code, Invoke-VenafiRestMethod -Method Post -UriLeaf 'Metadata/UpdateItem' -Body @{'Update' = @{'DN' = '\VED\Metadata Root\TestField'; 'Data' = @{'Name' = 'ErrorMessage'; 'Value' = 'Test Help Message'}}} has Data as a hashtable when it should be an array of hashtables (it looks like you fixed this in your second try). Also, a list type doesn't have an error message, only a string does when performing validation. When I try and update ErrorMessage for a list field I get a 400.

The following worked for me to update list options, Invoke-VenafiRestMethod -UriLeaf 'Metadata/UpdateItem' -Body @{'Update'=@{'DN'='\VED\Metadata Root\bb1639…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tonyb2BB
Comment options

Answer selected by tonyb2BB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants