File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -55,23 +55,17 @@ function Test-FabricApiResponse {
55
55
56
56
$responseHeader = $script :responseHeader
57
57
$statusCode = $script :statusCode
58
+ $result = $null
58
59
59
60
$verb = (Get-PSCallStack )[1 ].Command.Split(' -' )[0 ]
60
61
Write-Message - Message " Testing API response for '$verb ' operation. StatusCode: $statusCode ." - Level Debug
61
62
62
63
switch ($statusCode ) {
63
64
200 {
64
- return $null
65
+ $result = $null
65
66
}
66
67
201 {
67
- switch ($verb ) {
68
- ' New' { $msg = " $TypeName '$ObjectIdOrName ' created successfully!" }
69
- ' Update' { $msg = " $TypeName '$ObjectIdOrName ' updated successfully!" }
70
- ' Remove' { $msg = " $TypeName '$ObjectIdOrName ' deleted successfully!" }
71
- default { $msg = " Received $statusCode status code for $verb operation on $TypeName '$ObjectIdOrName '" }
72
- }
73
- Write-Message - Message $msg - Level Info
74
- return $Response
68
+ $result = $Response
75
69
}
76
70
202 {
77
71
Write-Message - Message " $verb Request for $TypeName '$ObjectIdOrName ' accepted. Provisioning in progress!" - Level Info
@@ -115,4 +109,17 @@ function Test-FabricApiResponse {
115
109
}
116
110
}
117
111
112
+ switch ($verb ) {
113
+ ' New' { $msg = " $TypeName '$ObjectIdOrName ' created successfully!" }
114
+ ' Update' { $msg = " $TypeName '$ObjectIdOrName ' updated successfully!" }
115
+ ' Remove' { $msg = " $TypeName '$ObjectIdOrName ' deleted successfully!" }
116
+ ' Get' { $msg = " " }
117
+ default { $msg = " Received $statusCode status code for $verb operation on $TypeName '$ObjectIdOrName '." }
118
+ }
119
+ if ($msg ) {
120
+ Write-Message - Message $msg - Level Info
121
+ }
122
+
123
+ $result
124
+
118
125
}
Original file line number Diff line number Diff line change @@ -77,8 +77,6 @@ function New-FabricSQLDatabase
77
77
}
78
78
# Step 5: Handle and log the response
79
79
Test-FabricApiResponse - Response $response - ObjectIdOrName $Name - TypeName ' SQL Database' - NoWait:$NoWait
80
-
81
- Write-Message - Message " SQL Database '$Name ' created successfully!" - Level Info
82
80
}
83
81
catch
84
82
{
Original file line number Diff line number Diff line change @@ -53,8 +53,6 @@ function Remove-FabricSQLDatabase
53
53
54
54
# Step 4: Validate the response code
55
55
Test-FabricApiResponse - Response $response - ObjectIdOrName $SQLDatabaseId - TypeName " SQL Database"
56
-
57
- Write-Message - Message " SQL Database '$SQLDatabaseId ' deleted successfully!" - Level Info
58
56
}
59
57
catch
60
58
{
You can’t perform that action at this time.
0 commit comments