This is possible using the hidden property PSObject
:
$documents.PSObject.Properties | ForEach-Object {
$_.Name
$_.Value
}
This won’t work with certain PowerShell-created objects (PSObject
s) that contain “NoteProperties” (properties of type NoteProperty
).
See this answer for a method that covers all property types.