DEV Community

Cover image for Reuse tfvars in Powershell
Antoine
Antoine

Posted on

1

Reuse tfvars in Powershell

Photo by Thought Catalog on Unsplash

To reuse data in Powershell set in tfvars, we just have to use the ConvertFrom-StringData cmdlet.

In order to remove some character (such as { or } ), we can use -replace .

That will give us

$file = Get-Content .\varfile.tfvars
$file = $file -replace "}", ""
$file = $file -replace "{", ""
$convert = $file | ConvertFrom-StringData
Enter fullscreen mode Exit fullscreen mode

Hope this help !

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more