for ($i=1; $i -le 4; $i++) { if (-not (test-path "foo$i")) { "foo$i is missing" } }