@@ -22,41 +22,40 @@ Get-FabricLongRunningOperation -operationId "12345-abcd-67890-efgh" -retryAfter
22
22
This command polls the status of the operation with the given operationId every 10 seconds until it completes.
23
23
24
24
. NOTES
25
- - Requires the `$FabricConfig` global object, including `BaseUrl` and `FabricHeaders`.
26
25
27
26
Author: Tiago Balabuch
28
27
29
28
#>
30
29
param (
31
30
[Parameter (Mandatory = $false )]
32
- [string ]$operationId ,
31
+ [string ]$OperationId ,
33
32
34
33
[Parameter (Mandatory = $false )]
35
- [string ]$location ,
34
+ [string ]$Location ,
36
35
37
36
[Parameter (Mandatory = $false )]
38
- [int ]$retryAfter = 5
37
+ [int ]$RetryAfter = 5
39
38
)
40
39
41
40
Write-Message - Message " [Get-FabricLongRunningOperation]::Begin" - Level Debug
42
41
Confirm-TokenState
43
42
44
43
# Step 1: Construct the API URL
45
- if (-not $operationId ) {
44
+ if (-not $OperationId ) {
46
45
# Use the Location header to define the operationUrl, if OperationId is not provided
47
- $apiEndpointUrl = $location
46
+ $apiEndpointUrl = $Location
48
47
} else {
49
- $apiEndpointUrl = " operations/{0}" -f $operationId
48
+ $apiEndpointUrl = " operations/{0}" -f $OperationId
50
49
}
51
50
Write-Message - Message " [Get-FabricLongRunningOperation] API Endpoint: $apiEndpointUrl " - Level Debug
52
51
53
52
try {
54
53
do {
55
54
56
55
# Step 2: Wait before the next request
57
- if ($retryAfter ) {
58
- Write-Message - Message " Waiting $retryAfter seconds..." - Level Verbose
59
- Start-Sleep - Seconds $retryAfter
56
+ if ($RetryAfter ) {
57
+ Write-Message - Message " Waiting $RetryAfter seconds..." - Level Verbose
58
+ Start-Sleep - Seconds $RetryAfter
60
59
} else {
61
60
Write-Message - Message " Waiting 5 seconds..." - Level Verbose
62
61
Start-Sleep - Seconds 5 # Default retry interval if no Retry-After header
0 commit comments