Terraform Output to set variables in PowerShell

Solution 1:

This should assist you with what you want:

$TerraformPath = "C:\tf\terraform.exe"

$Json_Output = (& $TerraformPath output -json) | ConvertFrom-Json

Change $TerraformPath to the location of your terraform.exe, I thought it would be best to take this route as I am unsure if you have terrraform in your environmental path.

All properties should then be in $Json_Output.