Contact

Subscribe via Email

Subscribe via RSS/JSON

Categories

Recent Posts

Creative Commons Attribution 4.0 International License
© Rakhesh Sasidharan

Elsewhere

Using comma to preserve arrays

I had mentioned earlier that when you pipe an array to the get-member cmdlet the array is unraveled.

While reading Bruce Payette’s excellent “Powershell in Action” book yesterday (and also coincidentally from an unrelated serverfault topic I was reading) I discovered that it’s possible to modify this behavior by prepending a , to the array. Like thus:

Notice it gives the type of the array as well as the various sub-types within it (strings and integers). Useful!

Using comma to preserve arrays by rakhesh is licensed under a Creative Commons Attribution 4.0 International License.