How to send "azure devops predefined variables" to my powerShell script

Hi,
I want to ask. How to send “azure devops predefined variables” to my powerShell script,
Azure devops predefined variables https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml
I want to send an Agent.TempDirectory.

local-exec provisioner {
command = “MyPowershellScript.ps1”
interpreter = [“PowerShell”, “-File”]
environment = {
temp_directory = $ (Agent.TempDirectory) # How to write it?
}
}

I think you can just access it as a normal env var in powershell $env:AGENT_TEMPDIRECTORY