Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit ec6b53e

Browse files
committed
Fixed loopcount
1 parent 70ff566 commit ec6b53e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.build.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,11 @@ task ValidateLiveMountTools {
103103
}
104104

105105
task ValidateRemoteScriptExecution {
106+
$i = 0
106107
foreach ($Mount in $MountArray) {
107108
while ($true) {
108-
$i = 1
109-
Write-Verbose -Message "Testing script execution on '$($Config.virtualMachines[$i].mountName)', attempt '$i'..." -Verbose
109+
$LoopCount = 1
110+
Write-Verbose -Message "Testing script execution on '$($Config.virtualMachines[$i].mountName)', attempt '$LoopCount'..." -Verbose
110111
$splat = @{
111112
ScriptText = 'hostname'
112113
ScriptType = 'PowerShell'
@@ -119,13 +120,14 @@ task ValidateRemoteScriptExecution {
119120
break
120121
} catch { }
121122

122-
$i++
123+
$LoopCount++
123124
Sleep -Seconds 5
124125

125-
if ($i -gt 5) {
126+
if ($LoopCount -gt 5) {
126127
throw "Could not execute script on: $($Config.virtualMachines[$i].mountName)..."
127128
}
128129
}
130+
$i++
129131
}
130132
}
131133

0 commit comments

Comments
 (0)