Skip to content

Commit 1aacaae

Browse files
authored
Merge pull request #152 from dataplat/bug/145-Remove-FabricWarehouse
Fixed misleading message from `Remove-FabricWarehouse` (#145)
2 parents 1218924 + fa433e4 commit 1aacaae

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3333
- `Get-FabricSqlDatabase` accepts Workspace as a pipeline, handles errors correctly and can filter by name (#117).
3434
- Applied splatting for several parameters in `Invoke-FabricRestMethod` and output results in debug mode
3535
- `Remove-FabricSQLDatabase` uses unified function to handle API results
36+
- Updated the `WorkspaceId`, `CapacitiesIds`,`CapacityId`,`CopyJobId`,`datamartId`,`DataPipelineId`,`DataWarehouseGUID`,`DomainId`,`EnvironmentId`,`EventhouseId`,`EventstreamId`,`ExternalDataShareId`,`ItemId`,`KQLDashboardId`,`KQLDatabaseId`,`KQLQuerysetId`,`LakehouseId`,`MirroredDatabaseId`,`MirroredWarehouseId`,`MLExperimentId`,`MLModelId`,`NotebookId`,`operationId`,`PaginatedReportId`,`ParentDomainId`,`parentEventhouseId`,`PrincipalId`,`ReflexId`,`ReportId`,`SemanticModelId`,`SparkCustomPoolId`,`SparkJobDefinitionId`,`SQLDatabaseId`,`SQLEndpointId`,`subscriptionID`,`UserId`,`WarehouseId`,`WorkspaceGUID`,`WorkspaceId`,`WorkspaceIds`, and `WorkspaceRoleAssignmentId` parameters to the datatype GUID [#125](https://github.com/dataplat/FabricTools/issues/125)
3637
- Internal function `Invoke-FabricRestMethod`: (#143)
3738
- handles API response, no need to use `Test-FabricApiResponse` from parent public function
3839
- handles pagination automatically (when `-HandleResponse` is provided)
3940
- All Deployment Pipeline functions raise an error when an exception is caught. Used splatting for params.
4041
- Refactored SQL Database functions to use enhanced capability in `Invoke-FabricRestMethod`. Used splatting for params.
4142
- `Write-Message` uses PSFramework function for logging, which logs function name (#84)
4243

43-
Updated the `WorkspaceId`, `CapacitiesIds`,`CapacityId`,`CopyJobId`,`datamartId`,`DataPipelineId`,`DataWarehouseGUID`,`DomainId`,`EnvironmentId`,`EventhouseId`,`EventstreamId`,`ExternalDataShareId`,`ItemId`,`KQLDashboardId`,`KQLDatabaseId`,`KQLQuerysetId`,`LakehouseId`,`MirroredDatabaseId`,`MirroredWarehouseId`,`MLExperimentId`,`MLModelId`,`NotebookId`,`operationId`,`PaginatedReportId`,`ParentDomainId`,`parentEventhouseId`,`PrincipalId`,`ReflexId`,`ReportId`,`SemanticModelId`,`SparkCustomPoolId`,`SparkJobDefinitionId`,`SQLDatabaseId`,`SQLEndpointId`,`subscriptionID`,`UserId`,`WarehouseId`,`WorkspaceGUID`,`WorkspaceId`,`WorkspaceIds`,and `WorkspaceRoleAssignmentId` parameters to the datatype GUID [#125](https://github.com/dataplat/FabricTools/issues/125)
44-
4544
### Fixed
4645

4746
- Enhanced logic in unified function `Test-FabricApiResponse` to handle API results and moved it to private functions
48-
- Fixed bug in `Get-FabricLongRunningOperation` - Uri was incorectly created (#131)
47+
- Fixed bug in `Get-FabricLongRunningOperation` - Uri was incorrectly created (#131)
4948
- Fixed bug in `Get-FabricLongRunningOperationResult` - uses correct statusCode (#131)
49+
- Fixed misleading message from `Remove-FabricWarehouse` (#145)
5050
- Fixed `Start-FabricDeploymentPipelineStage` that supports `-NoWait` correctly
5151

5252
### Deprecated

source/Public/Warehouse/Remove-FabricWarehouse.ps1

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
This example removes the warehouse with ID "warehouse-67890" from the workspace with ID "workspace-12345".
1818
1919
.NOTES
20-
- Requires `$FabricConfig` global configuration, including `BaseUrl` and `FabricHeaders`.
2120
- Calls `Confirm-TokenState` to ensure token validity before making the API request.
2221
2322
Author: Tiago Balabuch
@@ -44,14 +43,19 @@ function Remove-FabricWarehouse
4443

4544
if ($PSCmdlet.ShouldProcess($apiEndpointURI, "Delete Warehouse"))
4645
{
47-
# Step 3: Make the API request
48-
$response = Invoke-FabricRestMethod `
49-
-Uri $apiEndpointURI `
50-
-method Delete `
46+
# Step 3: Make the API request and Validate the response
47+
$apiParameters = @{
48+
Uri = $apiEndpointURI
49+
Method = 'DELETE'
50+
HandleResponse = $true
51+
TypeName = "Warehouse"
52+
ObjectIdOrName = $WarehouseId
53+
}
54+
$response = Invoke-FabricRestMethod @apiParameters
5155
}
5256

53-
Write-Message -Message "Warehouse '$WarehouseId' deleted successfully from workspace '$WorkspaceId'." -Level Info
54-
return $response
57+
# Step 4: Handle results
58+
$response
5559

5660
}
5761
catch

0 commit comments

Comments
 (0)