Skip to content

Instantly share code, notes, and snippets.

@maravedi
Created May 17, 2021 16:52
Show Gist options
  • Save maravedi/a7769d10f11e6090f7866db8d6039c6b to your computer and use it in GitHub Desktop.
Save maravedi/a7769d10f11e6090f7866db8d6039c6b to your computer and use it in GitHub Desktop.
Ansible Variable File to CSV
Get-Content .\main.yml | Where-Object { $_ -and ($_ -notmatch "^\s*(\-|#)" )} | Foreach-Object { ($_ -Split ": ") -Join ','} | ConvertFrom-CSV -Header Name, DefaultVaue | ConvertTo-CSV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment