Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Added `Id` parameter alias to Workspace functions that take `WorkspaceId` to support compatibility with API field names and issue #158.

### Deprecated

### Removed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function Add-FabricWorkspaceCapacityAssignment {
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Alias("Id")]
[guid]$WorkspaceId,

[Parameter(Mandatory = $true)]
Expand Down
1 change: 1 addition & 0 deletions source/Public/Workspace/Add-FabricWorkspaceIdentity.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function Add-FabricWorkspaceIdentity {
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Alias("Id")]
[guid]$WorkspaceId
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function Add-FabricWorkspaceRoleAssignment {
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Alias("Id")]
[guid]$WorkspaceId,

[Parameter(Mandatory = $true)]
Expand Down
1 change: 1 addition & 0 deletions source/Public/Workspace/Get-FabricWorkspace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function Get-FabricWorkspace {
param (
[Parameter(Mandatory = $false)]
[ValidateNotNullOrEmpty()]
[Alias("Id")]
[guid]$WorkspaceId,

[Parameter(Mandatory = $false)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function Get-FabricWorkspaceDatasetRefreshes {
param(
# Define a mandatory parameter for the workspace ID
[Parameter(Mandatory = $true)]
[Alias("Id")]
[guid]$WorkspaceID
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function Get-FabricWorkspaceRoleAssignment {
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Alias("Id")]
[guid]$WorkspaceId,

[Parameter(Mandatory = $false)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Author: Ioana Bouariu
# Define parameters for the workspace ID and username.
param(
[Parameter(Mandatory = $true)]
[Alias("Id")]
[guid]$WorkspaceId,
[Parameter(Mandatory = $false)]
[string]$username = ""
Expand Down
1 change: 1 addition & 0 deletions source/Public/Workspace/Get-FabricWorkspaceUser.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Author: Ioana Bouariu
# Define parameters for the workspace ID and workspace object.
param(
[Parameter(Mandatory = $true, ParameterSetName = 'WorkspaceId')]
[Alias("Id")]
[guid]$WorkspaceId,

[Parameter(Mandatory = $true, ParameterSetName = 'WorkspaceObject', ValueFromPipeline = $true )]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Author: Ioana Bouariu
# Define a parameter for the workspace ID.
param(
[Parameter(Mandatory = $true)]
[Alias("Id")]
[guid]$WorkspaceId
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ The ID of the capacity to which the workspace will be Seted. This is a mandatory
param(
# WorkspaceId is a mandatory parameter. It represents the ID of the workspace to be Seted.
[Parameter(ParameterSetName = 'WorkspaceId')]
[Alias("Id")]
[guid]$WorkspaceId,

# Workspace is a mandatory parameter. It represents the workspace object to be Seted.
Expand Down
1 change: 1 addition & 0 deletions source/Public/Workspace/Remove-FabricWorkspace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function Remove-FabricWorkspace {
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Alias("Id")]
[guid]$WorkspaceId
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function Remove-FabricWorkspaceCapacityAssignment
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Alias("Id")]
[guid]$WorkspaceId
)
try
Expand Down
1 change: 1 addition & 0 deletions source/Public/Workspace/Remove-FabricWorkspaceIdentity.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function Remove-FabricWorkspaceIdentity
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Alias("Id")]
[guid]$WorkspaceId
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function Remove-FabricWorkspaceRoleAssignment
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Alias("Id")]
[guid]$WorkspaceId,

[Parameter(Mandatory = $true)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function Unregister-FabricWorkspaceToCapacity {
[CmdletBinding(SupportsShouldProcess)]
param(
[Parameter(Mandatory = $true, ParameterSetName = 'WorkspaceId')]
[Alias("Id")]
[guid]$WorkspaceId,

[Parameter(Mandatory = $true, ParameterSetName = 'WorkspaceObject', ValueFromPipeline = $true)]
Expand Down
1 change: 1 addition & 0 deletions source/Public/Workspace/Update-FabricWorkspace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function Update-FabricWorkspace
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Alias("Id")]
[guid]$WorkspaceId,

[Parameter(Mandatory = $true)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function Update-FabricWorkspaceRoleAssignment
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Alias("Id")]
[guid]$WorkspaceId,

[Parameter(Mandatory = $true)]
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Add-FabricWorkspaceCapacityAssignment.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ Describe "Add-FabricWorkspaceCapacityAssignment" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'Add-FabricWorkspaceCapacityAssignment').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context 'When assigning capacity successfully (202)' {
BeforeAll {
Mock -CommandName Confirm-TokenState -MockWith { }
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Add-FabricWorkspaceIdentity.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ Describe "Add-FabricWorkspaceIdentity" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'Add-FabricWorkspaceIdentity').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context 'When provisioning identity successfully with immediate completion (200)' {
BeforeAll {
Mock -CommandName Confirm-TokenState -MockWith { }
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Add-FabricWorkspaceRoleAssignment.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ Describe "Add-FabricWorkspaceRoleAssignment" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'Add-FabricWorkspaceRoleAssignment').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context 'When assigning role successfully (201)' {
BeforeAll {
Mock -CommandName Confirm-TokenState -MockWith { }
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Get-FabricWorkspace.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ Describe "Get-FabricWorkspace" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'Get-FabricWorkspace').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context 'When retrieving workspaces successfully (200)' {
BeforeAll {
Mock -CommandName Confirm-TokenState -MockWith { }
Expand Down
7 changes: 6 additions & 1 deletion tests/Unit/Get-FabricWorkspaceDatasetRefreshes.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ Describe "Get-FabricWorkspaceDatasetRefreshes" -Tag "UnitTests" {
$Command | Should -HaveParameter -ParameterName $ExpectedParameterName -Type $ExpectedParameterType -Mandatory:([bool]::Parse($Mandatory))
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceID parameter' {
$param = (Get-Command -Name 'Get-FabricWorkspaceDatasetRefreshes').Parameters['WorkspaceID']
$param.Aliases | Should -Contain 'Id'
}
}
Context "Successful workspace dataset refreshes retrieval" -Skip {
# Skipped: Function calls Get-FabricDataset which does not exist in the module
BeforeAll {
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Get-FabricWorkspaceRoleAssignment.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ Describe "Get-FabricWorkspaceRoleAssignment" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'Get-FabricWorkspaceRoleAssignment').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context 'When getting all workspace role assignments successfully' {
BeforeAll {
Mock -CommandName Confirm-TokenState -MockWith { }
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Get-FabricWorkspaceUsageMetricsData.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ Describe "Get-FabricWorkspaceUsageMetricsData" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'Get-FabricWorkspaceUsageMetricsData').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context "Successful workspace usage metrics data retrieval" {
BeforeAll {
Mock -CommandName New-FabricWorkspaceUsageMetricsReport -MockWith {
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Get-FabricWorkspaceUser.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ Describe "Get-FabricWorkspaceUser" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'Get-FabricWorkspaceUser').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context "Alias validation" {
$testCases = @('Get-FabWorkspaceUsers', 'Get-FabricWorkspaceUsers')

Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/New-FabricWorkspaceUsageMetricsReport.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ Describe "New-FabricWorkspaceUsageMetricsReport" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'New-FabricWorkspaceUsageMetricsReport').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context "Successful workspace usage metrics report creation" {
BeforeAll {
Mock -CommandName Confirm-TokenState -MockWith { return $true }
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Register-FabricWorkspaceToCapacity.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ Describe "Register-FabricWorkspaceToCapacity" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'Register-FabricWorkspaceToCapacity').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context "Successful workspace registration" {
BeforeAll {
Mock -CommandName Invoke-FabricRestMethod -MockWith {
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Remove-FabricWorkspace.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ Describe "Remove-FabricWorkspace" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'Remove-FabricWorkspace').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context 'When removing workspace successfully (200)' {
BeforeAll {
Mock -CommandName Confirm-TokenState -MockWith { }
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Remove-FabricWorkspaceCapacityAssignment.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ Describe "Remove-FabricWorkspaceCapacityAssignment" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'Remove-FabricWorkspaceCapacityAssignment').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context "Successful capacity assignment removal" {
BeforeAll {
Mock -CommandName Invoke-FabricRestMethod -MockWith {
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Remove-FabricWorkspaceIdentity.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ Describe "Remove-FabricWorkspaceIdentity" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'Remove-FabricWorkspaceIdentity').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context "Successful workspace identity removal" {
BeforeAll {
Mock -CommandName Invoke-FabricRestMethod -MockWith {
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Remove-FabricWorkspaceRoleAssignment.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ Describe "Remove-FabricWorkspaceRoleAssignment" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'Remove-FabricWorkspaceRoleAssignment').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context "Successful workspace role assignment removal" {
BeforeAll {
Mock -CommandName Invoke-FabricRestMethod -MockWith {
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Unregister-FabricWorkspaceToCapacity.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ Describe "Unregister-FabricWorkspaceToCapacity" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'Unregister-FabricWorkspaceToCapacity').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context "Successful workspace unregistration from capacity" {
BeforeAll {
Mock -CommandName Invoke-FabricRestMethod -MockWith {
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Update-FabricWorkspace.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ Describe "Update-FabricWorkspace" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'Update-FabricWorkspace').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context 'When updating workspace successfully (200)' {
BeforeAll {
Mock -CommandName Confirm-TokenState -MockWith { }
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Update-FabricWorkspaceRoleAssignment.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ Describe "Update-FabricWorkspaceRoleAssignment" -Tag "UnitTests" {
}
}

Context 'Parameter alias validation' {
It 'Should have "Id" as an alias for WorkspaceId parameter' {
$param = (Get-Command -Name 'Update-FabricWorkspaceRoleAssignment').Parameters['WorkspaceId']
$param.Aliases | Should -Contain 'Id'
}
}

Context "Successful workspace role assignment update" {
BeforeAll {
Mock -CommandName Invoke-FabricRestMethod -MockWith {
Expand Down
Loading