Search notes:

PowerShell cmdLet convertFrom-stringData

convertFrom-stringData converts a string with key/value pairs to a hash table.
$data = @'
foo = 42
bar = 99

# Empty lines and lines
# starting with the comment
# character are ignored.

baz =  0
'@

$ht = convertFrom-stringData $data

write-output "Value of bar = $($ht['bar'])"
#
#  Value of bar = 99

write-output $ht
#
# Name                           Value
# ----                           -----
# baz                            0
# bar                            99
# foo                            42
Github repository about-PowerShell, path: /cmdlets/stringData/convertFrom/multiLine.ps1

See also

convertFrom-string
Powershell command noun: stringData
Object creation in PowerShell

Index