Questions tagged [member-access-enumeration]

PowerShell v3+ feature that uses regular dot notation to implicitly retrieve property values from or call methods on all elements of a collection.

This should be a synonym for the older tag. Please vote for adding this synonym, if you can.

5 questions
3
votes
2 answers

How to prevent ConvertFrom-Json from collapsing nested arrays if there's 1 element

Consider these two JSON files: { "tables": [ { "columns": [ { "name": "action", "type": "string" }, { "name": "region", "type": "string" }, { …
Tom Pažourek
  • 9,582
  • 8
  • 66
  • 107
2
votes
2 answers

How do I edit the values of imported CSV variable with PowerShell

The below script is an example of me importing a CSV file, trying to edit one of the values, then checking the value. $Animal_Farm = Import-CSV "Test.csv" Echo "The Data" $Animal_Farm Echo "`n`n`n" Echo "Dog's Status" $Animal_Farm.Status[1] Echo…
Baa
  • 438
  • 3
  • 7
  • 22
1
vote
1 answer

Why does GetType() return Object[] as the type on array, but a bad method call error says it is the type that is in the 0th element in the array?

So, I create an array, call GetType(), and I (reasonably) get the answer Object[]. If I, however, give it a bad method, I get the type of the 0th element in the error message. Just trying to understand Powershell more -- I assume this is because…
1
vote
1 answer

Updating XML with Powershell

Looking to use PowerShell to Update Web Server IP addresses. Multiple IPs on each host. Imported Config file has incorrect IP Address for the new configuration, so I want to change the IP by creating list of Site Names and Associated bindings in an…
MrTG
  • 13
  • 3
1
vote
1 answer

Using contains operator for array of objects in powershell

I have a powershell object array like this $EdosContainers= @([pscustomobject]@{Container='FoundationObjectStoreConfigMetadata';PartitionKey='/templateName'} …
Sandeep Thomas
  • 4,303
  • 14
  • 61
  • 132