Let’s assume you want to save settings to a file in the most simplest form. Your settings may look like this:
$settings = '
You could save these settings to file using Set-Content, and read them back using Get-Content.
Yet how would you parse the information so that you can access individual items? There is a cmdlet called ConvertFrom-StringData that turns your key-value pairs into a hash table:
$settings = @'
$hash = $settings | ConvertFrom-StringData
ReTweet this Tip!