powershell - ForEach Item in variable - get it's value -
i have script has 3 textboxes in user can put in information. after put in information, stored in variable this:
$v = $test.text $t = $test2.text $w = $test3.text $vtw = $v, $t, $w foreach ($item in $vtw) {write-host "hello"}
how can write-host
put out value of each variable in $vtw
?
at moment output
hello hello hello
i want 1 (actually value of those)
$test.text $test2.test $test3.text
i tried this, didn't work. suggestions?
$v = $test.text $t = $test2.text $w = $test3.text $vtw = $v, $t, $w foreach ($item in $vtw) {write-host $item}
you're joining strings
$vtw = $v, $t, $w
you should creating array: classified "@"
$vtw = @($v,$t,$w)
Comments
Post a Comment