Skip to content

Thotaz - Instead of using json as the config file, you could use a PowerShell data file? #1

@marcmylemans

Description

@marcmylemans

Instead of using json as the config file, you could use a PowerShell data file which IMO is nicer to edit by hand as it's just the normal PowerShell syntax and you don't have to worry about escaping backslashes, adding commas after every element, and quoting everything. Here's a snippet of what the file would look like:

@{
    VMS = @(
        @{Name = "dc1"; IP = "192.168.48.10"}
        @{Name = "rdgw"; IP = "192.168.48.11"}
    )
    DomainController = "dc1"
    TemplateVHDXPath = "C:\Hyper-V\Virtual Hard Disks\Templates\template_server2019.vhdx"
}

And you'd import it like:
$Data = Import-PowerShellDataFile -Path .\Demo.psd1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions