How can I pass array of hashes to function that is in an imported module in Powershell?
And Is there a difference between Powershell 3.0 and 2.0? So that I can use a back compatible syntax?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no difference between PowerShell 2.0 and 3.0 in this area. You simply create an array of hashtables and pass them into your function e.g.:
Your function could be defined as either:
or