Skip to content

Commit 7b588c0

Browse files
Update all id parameters to use guids instead of strings as datatypes closes #125 (#126)
* Change WorkspaceId and LakehouseId parameters to GUID Replace type for all `Id` input parameters from [String] to [Guid] #125 Updated parameter types for WorkspaceId and LakehouseId to GUID in multiple scripts to ensure better validation and consistency across the codebase. This change enhances the robustness of the functions by enforcing the correct data type. Thank you! * Refactor parameter types in PowerShell scripts to use [guid] for WorkspaceId, ReflexId, ReportId, and other identifiers - Updated parameter types from [string] to [guid] in multiple scripts across the Public/Reflex, Public/Report, Public/Restore Points, Public/SQL Database, Public/Spark, Public/Tenant, Public/Users, Public/Utils, Public/Warehouse, and Public/Workspace directories. - This change enhances type safety and ensures that only valid GUIDs are accepted for these parameters. * Update parameter types to GUID in CHANGELOG and script Updated the `WorkspaceId`, `CapacitiesIds`, and various other parameters to use the GUID datatype for consistency and improved type safety. This change enhances the clarity and reliability of the code. Thank you! * Fix syntax error in Export-FabricItem function Corrected the conditional check for itemID to ensure proper functionality. This change enhances the reliability of the function when exporting items from a Fabric workspace. Thank you! * Add tests for parameter types in functions This commit introduces a new test suite to verify that function parameters ending with 'id' are of type System.Guid. This ensures consistency and correctness in parameter types across the module. Thank you! * So that the parameter data type is correct Updated the WorkspaceId parameter type from string to GUID for better validation and to ensure correct input format. This change enhances the function's robustness and prevents potential errors. Thank you!
1 parent 0d36065 commit 7b588c0

File tree

191 files changed

+354
-320
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+354
-320
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- Renamed `Get-FabricWorkspaceUsers` to match the singular form
1616
- Get-FabricSqlDatabase accepts Workspace as a pipeline, handles errors correctly and can filter by name (#117).
1717

18+
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)
19+
20+
21+
1822
### Fixed
1923
### Deprecated
2024
### Removed

FabricTools.code-workspace

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
}
6+
]
7+
}

source/Private/Get-FabricUri.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ function Get-FabricUri {
3434
param (
3535
$BaseUrl = 'api.powerbi.com',
3636
[parameter(Mandatory)]
37-
[String]$WorkspaceGUID,
37+
[guid]$WorkspaceGUID,
3838
[parameter(Mandatory)]
39-
[String]$DataWarehouseGUID,
39+
[guid]$DataWarehouseGUID,
4040

41-
[String]$BatchId
41+
[guid]$BatchId
4242
)
4343

4444
try {

source/Public/Capacity/Get-FabricCapacities.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function Get-FabricCapacities {
3030
Param (
3131
# Optional parameter for subscription ID
3232
[Parameter(Mandatory = $false)]
33-
[string]$subscriptionID
33+
[guid]$subscriptionID
3434
)
3535

3636
# Initialize an array to store the results

source/Public/Capacity/Get-FabricCapacity.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function Get-FabricCapacity {
3232
param (
3333
[Parameter(Mandatory = $false)]
3434
[ValidateNotNullOrEmpty()]
35-
[string]$capacityId,
35+
[guid]$capacityId,
3636

3737
[Parameter(Mandatory = $false)]
3838
[ValidateNotNullOrEmpty()]

source/Public/Capacity/Get-FabricCapacitySkus.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Author: Kamil Nowinski
2828

2929
Param(
3030
[Parameter(Mandatory = $true)]
31-
[string]$subscriptionID,
31+
[guid]$subscriptionID,
3232
[Parameter(Mandatory = $true)]
3333
[string]$ResourceGroupName,
3434
[Parameter(Mandatory = $true)]

source/Public/Capacity/Get-FabricCapacityState.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Author: Ioana Bouariu
3434
# Define mandatory parameters for the subscription ID, resource group, and capacity.
3535
Param (
3636
[Parameter(Mandatory = $true)]
37-
[string]$subscriptionID,
37+
[guid]$subscriptionID,
3838
[Parameter(Mandatory = $true)]
3939
[string]$resourcegroup,
4040
[Parameter(Mandatory = $true)]

source/Public/Capacity/Get-FabricCapacityWorkload.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Author: Ioana Bouariu
2828
# Define a mandatory parameter for the capacity ID.
2929
Param (
3030
[Parameter(Mandatory = $true)]
31-
[string]$capacityID
31+
[guid]$CapacityId
3232
)
3333

3434
Confirm-TokenState

source/Public/Capacity/Resume-FabricCapacity.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Author: Ioana Bouariu
3434
# Define parameters for the subscription ID, resource group, and capacity.
3535
Param (
3636
[Parameter(Mandatory = $true)]
37-
[string]$subscriptionID,
37+
[guid]$subscriptionID,
3838
[Parameter(Mandatory = $true)]
3939
[string]$resourcegroup,
4040
[Parameter(Mandatory = $true)]

source/Public/Capacity/Suspend-FabricCapacity.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Author: Ioana Bouariu
3535
# Define parameters for the subscription ID, resource group, and capacity.
3636
Param (
3737
[Parameter(Mandatory = $true)]
38-
[string]$subscriptionID,
38+
[guid]$subscriptionID,
3939
[Parameter(Mandatory = $true)]
4040
[string]$resourcegroup,
4141
[Parameter(Mandatory = $true)]

0 commit comments

Comments
 (0)