Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-String.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,23 +220,23 @@ Notice the difference in alignment for the age column between both examples.
### Example 5A: Get to know the generated object

```
$template = @'
{[string]Name*:Phoebe Cat}, {[string]phone:425-123-6789}, {[int]age:6}
{[string]Name*:Lucky Shot}, {[string]phone:(206) 987-4321}, {[int]age:12}
'@

$testText = @'
Phoebe Cat, 425-123-6789, 6
Lucky Shot, (206) 987-4321, 12
Elephant Wise, 425-888-7766, 87
Wild Shrimp, (111) 222-3333, 1
'@

$testText |
ConvertFrom-String -TemplateContent $template -OutVariable PersonalData |
Out-Null

$PersonalData | Get-Member
$template = @'
{[string]Name*:Phoebe Cat}, {[string]phone:425-123-6789}, {[int]age:6}
{[string]Name*:Lucky Shot}, {[string]phone:(206) 987-4321}, {[int]age:12}
'@

$testText = @'
Phoebe Cat, 425-123-6789, 6
Lucky Shot, (206) 987-4321, 12
Elephant Wise, 425-888-7766, 87
Wild Shrimp, (111) 222-3333, 1
'@

$testText |
ConvertFrom-String -TemplateContent $template -OutVariable PersonalData |
Out-Null

$PersonalData | Get-Member



Expand Down