adplus-dvertising
frame-decoration

Question

In PowerShell, how is an array created, and how is an element accessed?

a.

create array = [values]; get array[index]

b.

array = values; retrieve array(index)

c.

$array = values; $array(index)

d.

$array = values; $array[index]

Answer: (d).$array = values; $array[index] Explanation:In PowerShell, an array is created by using the syntax "$array = values," and an element is accessed using "$array[index]."

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. In PowerShell, how is an array created, and how is an element accessed?