1..100 | ForEach-Object { $s = '' if ($_ % 3 -eq 0) { $s += "Fizz" } if ($_ % 5 -eq 0) { $s += "Buzz" } if (-not $s) { $s = $_ } $s }