Description
Problem description
Currently, all functions do use [string] as type for input parameters like WorkspaceId
, WarehouseId
, ***Id
.
When user pass wrong value for such parameters it result in error and may cost presious time to trouble shoot.
It's best practice to use a specific type when possible:
Use Strongly-Typed .NET Framework Types
Hence, a recommendation to replace all [String] with [Guid] for all parameters with that type.
Example:
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$WorkspaceId,
[Parameter(Mandatory = $false)]
[ValidateNotNullOrEmpty()]
[string]$LakehouseId
)
What happened when a user provides an incorrect value (non-guid) now:
Verbose logs
See above
Module Version
Pre-release
Suggested solution
Recommendation to replace all [String] with [Guid] for all parameters with that type.
Example of new code:
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Guid]$WorkspaceId,
[Parameter(Mandatory = $false)]
[ValidateNotNullOrEmpty()]
[Guid]$LakehouseId
)
What happened when a user provides an incorrect value (non-guid) after the change:
This allows us to catch the error as early as possible and face further errors or (even worse) misleading output.