Saving a DSC data file

Welcome Forums DSC (Desired State Configuration) Saving a DSC data file

This topic contains 1 reply, has 2 voices, and was last updated by

 
Keymaster
3 years, 2 months ago.

  • Author
    Posts
  • #31845

    Participant
    Points: 0
    Rank: Member

    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

    Keymaster
    Points: 1,785
    Helping HandTeam Member
    Rank: Community Hero

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

The topic ‘Saving a DSC data file’ is closed to new replies.