I have gone through several article to understand this, but below is the one which looks most simple to me, the reason is - below one is dynamic and can be used easily in your scripts -
$arr=@()
$arr += "ABC"
$arr += "XYZ"
$arr += "PQR"
$arr[0]
ABC
$arr[1]
XYZ
$arr[2]
PQR
$arr.count
3
for ($x=0; $x -lt $arr.count; $x++) { echo ${arr}[$x] }
ABC
XYZ
PQR
Simple and effective! This is something which we want in all our scripts.
This is dynamic and you can assign so many values in different functions. I will take in detail later.... Keep sending your comments / mails.
$arr=@()
$arr += "ABC"
$arr += "XYZ"
$arr += "PQR"
$arr[0]
ABC
$arr[1]
XYZ
$arr[2]
PQR
$arr.count
3
for ($x=0; $x -lt $arr.count; $x++) { echo ${arr}[$x] }
ABC
XYZ
PQR
Simple and effective! This is something which we want in all our scripts.
This is dynamic and you can assign so many values in different functions. I will take in detail later.... Keep sending your comments / mails.
No comments:
Post a Comment