@@ -7,19 +7,13 @@ function Test-FabricApiResponse {
7
7
. DESCRIPTION
8
8
Tests the response from a Fabric API call and handles long-running operations. It checks the status code and processes the response accordingly.
9
9
10
- . PARAMETER statusCode
11
- The HTTP status code returned from the API call.
12
-
13
- . PARAMETER response
10
+ . PARAMETER Response
14
11
The response body from the API call.
15
12
16
- . PARAMETER responseHeader
17
- The response headers from the API call.
18
-
19
13
. PARAMETER Name
20
14
The name of the resource being operated.
21
15
22
- . PARAMETER typeName
16
+ . PARAMETER TypeName
23
17
The type of resource being operated (default: 'Fabric Item').
24
18
25
19
. PARAMETER NoWait
@@ -47,13 +41,13 @@ function Test-FabricApiResponse {
47
41
[CmdletBinding ()]
48
42
param (
49
43
[Parameter (Mandatory = $false )]
50
- $response ,
44
+ $Response ,
51
45
52
46
[Parameter (Mandatory = $false )]
53
47
$Name ,
54
48
55
49
[Parameter (Mandatory = $false )]
56
- $typeName = ' Fabric Item' ,
50
+ $TypeName = ' Fabric Item' ,
57
51
58
52
[Parameter (Mandatory = $false )]
59
53
[switch ] $NoWait = $false
@@ -71,16 +65,16 @@ function Test-FabricApiResponse {
71
65
}
72
66
201 {
73
67
switch ($verb ) {
74
- ' New' { $msg = " $typeName '$Name ' created successfully!" }
75
- ' Update' { $msg = " $typeName '$Name ' updated successfully!" }
76
- ' Remove' { $msg = " $typeName '$Name ' deleted successfully!" }
77
- default { $msg = " Received 201 status code for $verb operation on $typeName '$Name '" }
68
+ ' New' { $msg = " $TypeName '$Name ' created successfully!" }
69
+ ' Update' { $msg = " $TypeName '$Name ' updated successfully!" }
70
+ ' Remove' { $msg = " $TypeName '$Name ' deleted successfully!" }
71
+ default { $msg = " Received 201 status code for $verb operation on $TypeName '$Name '" }
78
72
}
79
73
Write-Message - Message $msg - Level Info
80
- return $response
74
+ return $Response
81
75
}
82
76
202 {
83
- Write-Message - Message " $verb Request for $typeName '$Name ' accepted. Provisioning in progress!" - Level Info
77
+ Write-Message - Message " $verb Request for $TypeName '$Name ' accepted. Provisioning in progress!" - Level Info
84
78
[string ]$operationId = $responseHeader [" x-ms-operation-id" ]
85
79
86
80
if ($NoWait ) {
0 commit comments