Allow a script or API to update the secret custom field

I would like to be able to update the encrypted (secret) asset custom field via Powershell or the API.