Skip to content

Commit 6d5807a

Browse files
committed
fix write-verbose
1 parent e817f66 commit 6d5807a

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/tests/scripts/create-subscriptions.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[CmdletBinding()]
12
param(
23
[string]$billingScope,
34
[string]$subscriptionNamePrefix = "accelerator-bootstrap-modules",
@@ -25,7 +26,7 @@ Write-Host "====================================" -ForegroundColor Cyan
2526
Write-Host ""
2627

2728
$confirmation = Read-Host "Do you want to continue with this account? (y/n)"
28-
if ($confirmation -ne 'y' -and $confirmation -ne 'Y') {
29+
if ($confirmation -ine 'y') {
2930
Write-Host "Operation cancelled by user." -ForegroundColor Red
3031
exit 0
3132
}
@@ -112,7 +113,7 @@ if ($planOnly) {
112113

113114
# Prompt for confirmation before creating
114115
$createConfirmation = Read-Host "Do you want to create these $($subscriptionsToCreate.Count) subscription(s)? (y/n)"
115-
if ($createConfirmation -ne 'y' -and $createConfirmation -ne 'Y') {
116+
if ($createConfirmation -ine 'y') {
116117
Write-Host "Operation cancelled by user." -ForegroundColor Red
117118
return
118119
}
@@ -132,6 +133,7 @@ $results = $subscriptionsToCreate | ForEach-Object -Parallel {
132133
$scope = $using:billingScope
133134
$retries = $using:maxRetries
134135
$state = $using:rateLimitState
136+
$VerbosePreference = $using:VerbosePreference
135137
$retryCount = 0
136138
$success = $false
137139

@@ -156,7 +158,8 @@ $results = $subscriptionsToCreate | ForEach-Object -Parallel {
156158
$hours = [int]$Matches[1]
157159
$minutes = [int]$Matches[2]
158160
$seconds = [int]$Matches[3]
159-
$waitSeconds = ($hours * 3600) + ($minutes * 60) + $seconds + 10 # Add 10 seconds buffer
161+
$waitSeconds = ($hours * 3600) + ($minutes * 60) + $seconds + (1 * 60) # Add 60 second buffer
162+
Write-Verbose $errorMessage
160163

161164
# Set the shared rate limit wait time
162165
$newWaitUntil = [DateTime]::Now.AddSeconds($waitSeconds)

0 commit comments

Comments
 (0)