From 48cc836717fa93e60144ef48364b6e0c309d998f Mon Sep 17 00:00:00 2001 From: Yu-Ju Hong Date: Wed, 21 Aug 2019 15:40:30 -0700 Subject: [PATCH] GCE/Windows: use "return" as "continue" for ForEach-Object Using `continue` would exit the current processing scope. https://blogs.technet.microsoft.com/msftcam/2015/03/17/powershell-gotcha-foreach-object-and-continue/ --- cluster/gce/windows/testonly/install-ssh.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/gce/windows/testonly/install-ssh.psm1 b/cluster/gce/windows/testonly/install-ssh.psm1 index 418738fde31..a35ac220cbc 100644 --- a/cluster/gce/windows/testonly/install-ssh.psm1 +++ b/cluster/gce/windows/testonly/install-ssh.psm1 @@ -206,7 +206,7 @@ while($true) { if (-not (Test-Path $user_dir)) { # If for some reason Create-NewProfile failed to create the user profile # directory just continue on to the next user. - continue + return } # NOTE: there is a race condition here where someone could try to ssh to