[array]$tmpary= @()
Add Array:
$tmpary+= "a"
$tmpary+= "b"
$tmpary+= "c"
Get Array:
if ($ary.Count -gt 0)
{
foreach ($element in $ary)
{
echo $element
}
}
Array Contains & Notcontains:
if ($tempary -contains "a")
{
echo "a exists."
}
if ($tempary -notcontains "d")
{
echo "d not exists."
}
沒有留言:
張貼留言