Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(GH-10505) Add note on property name ordering #10507

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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: PSCustomObject is a simple way to create structured data.
ms.custom: contributor-KevinMarquette
ms.date: 06/07/2023
ms.date: 10/11/2023
title: Everything you wanted to know about PSCustomObject
---
# Everything you wanted to know about PSCustomObject
Expand Down Expand Up @@ -129,6 +129,10 @@ We can get this same list off of the `psobject` property too.
$myobject.psobject.properties.name
```

> [!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.

### Dynamically accessing properties

I already mentioned that you can access property values directly.
Expand Down