Skip to content

Commit 8dccae2

Browse files
committed
minor formatting, update to OTBS
1 parent adf3242 commit 8dccae2

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

PList Reader.ps1

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,10 @@ function ConvertFrom-Plist {
5252
# note: keys are forced to [string], insures a $null key is accepted
5353
$collection[[string][plistreader]::processTree($currnode.FirstChild)] = [plistreader]::processTree($currnode.NextSibling)
5454
$currnode = $currnode.NextSibling.NextSibling # skip the next sibling because it was the value of the property
55-
}
56-
else {
55+
} else {
5756
throw "Dictionary property value missing!"
5857
}
59-
}
60-
else {
58+
} else {
6159
throw "Non 'key' element found in dictionary: <$($currnode.Name)>!"
6260
}
6361
}
@@ -79,15 +77,13 @@ function ConvertFrom-Plist {
7977
# must be an integer type value element, return its value
8078
[plistreader]::processTree($node.FirstChild).foreach{
8179
# try to determine what size of interger to return this value as
82-
if ([int]::TryParse( $_, [ref]$null)) {
80+
if ([int]::TryParse($_, [ref]$null)) {
8381
# a 32bit integer seems to work
8482
$_ -as [int]
85-
}
86-
elseif ([int64]::TryParse( $_, [ref]$null)) {
83+
} elseif ([int64]::TryParse($_, [ref]$null)) {
8784
# a 64bit integer seems to be needed
8885
$_ -as [int64]
89-
}
90-
else {
86+
} else {
9187
# try an unsigned 64bit interger, the largest available here.
9288
$_ -as [uint64]
9389
}
@@ -114,8 +110,7 @@ function ConvertFrom-Plist {
114110
throw "Unhandled PLIST property type <$($node.Name)>!"
115111
}
116112
}
117-
}
118-
else {
113+
} else {
119114
# return simple element value (need to check for Boolean datatype, and process value accordingly)
120115
switch ($node.Name) {
121116
true { $true; continue } # return a Boolean TRUE value

0 commit comments

Comments
 (0)