Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 4.0 » ConvertFrom-StringData

ConvertFrom-StringData - Powershell 4.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »

ConvertFrom-StringData

Short description
Converts a string containing one or more key and value pairs to a hash table.

Syntax


Description
The ConvertFrom-StringData cmdlet converts a string that contains one or more key and value pairs into a hash table. 
Because each key/value pair must be on a separate line, here-strings are often used as the input format.


The ConvertFrom-StringData cmdlet is considered to be a safe cmdlet that can be used in the DATA section of a script 
or function. When used in a DATA section, the contents of the string must conform to the rules for a DATA section. For 
more information, see about_Data_Sections.


ConvertFrom-StringData supports escape character sequences that are allowed by conventional machine translation tools. 
That is, the cmdlet can interpret backslashes (\) as escape characters in the string data by using the Regex.Unescape 
Method, instead of the Windows PowerShell backtick character (`) that would normally signal the end of a line in a 
script. Inside the here-string, the backtick character does not work. You can also preserve a literal backslash in 
your results by escaping it with a preceding backslash, like this:  \\. Unescaped backslash characters, such as those 
that are commonly used in file paths, can render as illegal escape sequences in your results.