Skip to content

Commit

Permalink
fixed example usage code block
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Cromwell committed Mar 2, 2012
1 parent f4bc219 commit 46a1975
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions JSON 1.7.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,9 @@ Function ConvertFrom-Xml {
[Switch]$ForceType
)
PROCESS{
if(Get-Member -InputObject $xml -Name root) {
if($xml.Item("root") -ne $null) {
return $xml.root.Objects | ConvertFrom-Xml
} elseif(Get-Member -InputObject $xml -Name Objects) {
} elseif($xml.Item("Objects") -ne $null) {
return $xml.Objects | ConvertFrom-Xml
}
$propbag = @{}
Expand All @@ -443,7 +443,13 @@ Function ConvertFrom-Xml {
$output.PsTypeNames.Insert(0, $xml.__type)
}
} else {
if( $propbag.Count -eq 0) {
$output = New-Object PSObject
}
else {
$output = New-Object PSObject -Property $propbag
}

if($Type) {
$output.PsTypeNames.Insert(0, $Type)
}
Expand Down
Binary file modified gist.ps1
Binary file not shown.

0 comments on commit 46a1975

Please sign in to comment.