Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ You can then access and use the values like you would a normal object.
$myObject.Name
```

To get name or value by index-number

```powershell
$myObject.psobject.properties.Name[2]
$myObject.psobject.properts.Value[2]
```

Comment on lines +44 to +50
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an appropriate example. You example returns the State property, not the Name property.

### Converting a hashtable

While I am on the topic, did you know you could do this:
Expand Down Expand Up @@ -129,6 +136,13 @@ We can get this same list off of the `psobject` property too.
$myobject.psobject.Properties.Name
```

Or to get all values

```powershell
$myobject.psobject.Properties.Value
```


> [!NOTE]
> `Get-Member` returns the properties in alphabetical order. Using the member-access operator to
> enumerate the property names returns the properties in the order they were defined on the object.
Expand Down
Loading