In reference to Updating Environment Variables in Managed Solution in which @EricRegnier posts a solution to change environment variables during deployment through a devops pipeline.
He posts the following shell script:
function Update-EnvVariable (
[Guid] $EnvVariableId,
[Microsoft.Xrm.Tooling.Connector.CrmServiceClient] $Connection
) {
$updateFields = @{ }
$updateFields.Add("value", $Value)
Set-CrmRecord -conn $Connection -Fields $updateFields -Id $EnvVariableId -EntityLogicalName "environmentvariablevalue"
}
However, I am having problems getting the shell script to work.
I'm getting the following error:
Missing type name after '['.
I've replaced the GUID with the id of my environment variable and "value" with the new environment variable value.
I suppose I'm missing some important detail, but could anyone point me in the right direction?