1. 循环遍历 foreach
$a=‘a‘,‘b‘,‘c‘
foreach ($i in $a)
{
echo $i
}
a
b
c
2. 循环遍历 foreach-object
$a | ForEach-Object{
echo $_
}
a
b
c
2023-09-29 18:29:04
$a=‘a‘,‘b‘,‘c‘
foreach ($i in $a)
{
echo $i
}
a
b
c
$a | ForEach-Object{
echo $_
}
a
b
c