Saving a DSC data file

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 11 months, 2 weeks ago.

  • Author
  • #31845
    Profile photo of Alexis Coles
    Alexis Coles

    Hi guys,

    So I have a DSC system set up and is working fairly well, however I would like to automate some of the Environment data setup. I have defined my environment data much like the examples in the documentation

    I can then read this data like so

    $content = (Invoke-Expression(Get-Content $dataFile | Out-String ))

    I would like to be able to set some of the details (easy enough) and then write it back to file (not so easy it seems). Does anyone know of any command that will let me serialize it back to a string so it can be written to file in much the same format as in the above documentation example?

  • #31940
    Profile photo of Don Jones
    Don Jones

    There's nothing natively built-in – I'm not sure this is a use case that the team explicitly planned for.

You must be logged in to reply to this topic.