Piping environment variable into an exec command

Good morning,

I would like to do the following in my Vault-Agent.hcl:

template_config {
static_secret_render_interval = “5m”
exit_on_retry_failure = false
max_connections_per_host = 10
}

env_template “SVC_SECRETS” {
contents = “{{ with secret “MyName/data/MyKVPath” }}{{ .Data.data | toJSON }}{{ end }}”
}

exec {
command = [“%SVC_SECRETS% | C:/Cli/MyApp.exe”, “-–output-path”, “D:\secrets”]
}

I would like to pipe the environment variable to an exe I created so I can use it in my code. Is this at all possible with vault templating or are there better alternatives to accomplish this?

Vault agent returns an error:
“error”:“unable to restart the child process: error starting the child process: exec: “%SVC_SECRETS% | C:/Cli/MyApp.exe”: file does not exist”,“exitCode”:1

I’m running the vault agent on windows server, version 1.21.2

Comments will be highly appreciated.

Marc