Skip to content

Commit 2525784

Browse files
🪲 [Fix]: Fix retry logic (#20)
## Description This pull request includes a small change to the `scripts/main.ps1` file. The change modifies the loop conditions in the script to ensure proper iteration and error handling. * [`scripts/main.ps1`](diffhunk://#diff-dc2e5a659836b1b73abb03421c567f5018c2755677c4a0aa764cb26117b68011L35-R40): Changed the loop initialization and condition from starting at 0 to starting at 1 and adjusted the comparison to ensure the loop runs the correct number of times. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 080b28e commit 2525784

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/main.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ if (-not $alreadyInstalled) {
3232
}
3333
$Count = 5
3434
$Delay = 10
35-
for ($i = 0; $i -lt $Count; $i++) {
35+
for ($i = 1; $i -le $Count; $i++) {
3636
try {
3737
Install-PSResource @params
3838
break
3939
} catch {
40-
if ($i -eq $Count - 1) {
40+
if ($i -eq $Count) {
4141
throw $_
4242
}
4343
Start-Sleep -Seconds $Delay

0 commit comments

Comments
 (0)