Skip to content

ConvertTo-Hcl

SYNOPSIS

Converts a PowerShell object to an HCL string.

SYNTAX

__AllParameterSets

ConvertTo-Hcl [-InputObject] <Object> [<CommonParameters>]

ALIASES

This cmdlet has the following aliases, {{Insert list of aliases}}

DESCRIPTION

Converts a PowerShell object into a HashiCorp Configuration Language (HCL) formatted string, suitable for use in Terraform configuration files (.tf), variable files (.tfvars), and other infrastructure-as-code tooling.

EXAMPLES

EXAMPLE 1

@{ environment = 'production' } | ConvertTo-Hcl

Converts a PowerShell hashtable to an HCL string.

PARAMETERS

-InputObject

The PowerShell object to convert to HCL.

Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.Object

{{ Fill in the Description }}

OUTPUTS

NOTES

{{ Fill in the related links here }}