File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
reference/docs-conceptual/learn/deep-dives Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,13 @@ You can then access and use the values like you would a normal object.
4141$myObject.Name
4242```
4343
44+ To get name or value by index-number
45+
46+ ``` powershell
47+ $myObject.psobject.properties.Name[2]
48+ $myObject.psobject.properts.Value[2]
49+ ```
50+
4451### Converting a hashtable
4552
4653While I am on the topic, did you know you could do this:
@@ -129,6 +136,13 @@ We can get this same list off of the `psobject` property too.
129136$myobject.psobject.Properties.Name
130137```
131138
139+ Or to get all values
140+
141+ ``` powershell
142+ $myobject.psobject.Properties.Value
143+ ```
144+
145+
132146> [ !NOTE]
133147> ` Get-Member ` returns the properties in alphabetical order. Using the member-access operator to
134148> enumerate the property names returns the properties in the order they were defined on the object.
You can’t perform that action at this time.
0 commit comments