Skip to content

Instantly share code, notes, and snippets.

@steviecoaster
Created October 3, 2019 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steviecoaster/89d061f5d2d473d7701eefaf999c85b3 to your computer and use it in GitHub Desktop.
Save steviecoaster/89d061f5d2d473d7701eefaf999c85b3 to your computer and use it in GitHub Desktop.
ConvertFrom-StringData Changes

Example 9: Use a different delimiter to split a string into a hashtable

$Here = @'
Msg1 : The string parameter is required.
Msg2 : Credentials are required for this command.
Msg3 : The specified variable does not exist.
'@
ConvertFrom-StringData -StringData $Here -Delimiter ':'
Name                           Value
----                           -----
Msg3                           The specified variable does not exist.
Msg2                           Credentials are required for this command.
Msg1                           The string parameter is required.

-Delimiter

Specifies the delimiter on which to split the string. The parameter name is optional.

The value of this parameter must be a char that is enclosed in single quotation marks, or a char that is enclosed in double quotation marks.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment