Skip to content

Instantly share code, notes, and snippets.

@dsudduth
Created August 22, 2021 21:13
Show Gist options
  • Select an option

  • Save dsudduth/5fc8c2855570728636d43564553102dd to your computer and use it in GitHub Desktop.

Select an option

Save dsudduth/5fc8c2855570728636d43564553102dd to your computer and use it in GitHub Desktop.
Demonstrates how to generate a JSON document in PowerShell.
$AMI = "ami-56666777788889999"
$params = @{
parameters = @(
@{
name = '/AMI/RHEL8_AMI'
value = $AMI
}
)
}
$json = $params | ConvertTo-Json
Write-Host $json
$json | Out-File 'demo.json'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment