dave...@gmail.com
unread,Nov 5, 2021, 12:01:00 PM11/5/21You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
On 29/10/2021 15:12, Walter H. wrote:
> Hello
>
> XXX |ForEach Write-Host $_
>
> what do I have to enter instead of XXX to get e.g.
>
> 1
> 2
> 3
> 4
> 5
>
> as output (Write-Host)?
>
> Thanks,
> Walter
Try:
1,2,3,4,5 | foreach-object -process { write-host $_ }
or perhaps
for ($x=1;$x -lt 6;$x++) { write-host $x}