I have this PSObject
(from XML):
bool : {IsActive, ShowOnB2C, ShowOnB2B, IsWebNews}
str : {id, ProductId, GroupName, Unit...}
int : {ProductIdNumeric, Prices_SalesOne, Prices_Treater, Prices_B2C...}
arr : {EnvironmentBrands, Catalogs, NavisionLevels}
long : long
I would like to iterate over the properties without using the property names, for instance bool
.
I have tried to index into the object like this:
$document[0]
But that gives me nothing, but it does not cause any errors either.
Select-Object
kind of works, but then I have to use the property names, and I don't want that.
$documents | Select-Object bool,str
ForEach
do not iterate the properties.
$documents | ForEach {
$_.name
}
returns doc and that is the name of the tag (XML) holding the bools, ints, and strings.