Skip to content

Commit 2c96937

Browse files
authored
Merge pull request #179 from dataplat/develop
Version 0.31
2 parents 246e281 + e2ac1d8 commit 2c96937

38 files changed

+589
-168
lines changed

.devcontainer/devcontainer.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "FabricTools PowerShell Dev",
3+
"features": {
4+
"ghcr.io/devcontainers/features/powershell:1": {},
5+
"ghcr.io/devcontainers/features/git:1": {},
6+
"ghcr.io/devcontainers/features/common-utils:2": {},
7+
"ghcr.io/devcontainers/features/azure-cli:1": {},
8+
"ghcr.io/devcontainers/features/github-cli:1": {}
9+
},
10+
11+
"customizations": {
12+
"vscode": {
13+
"extensions": [
14+
"davidanson.vscode-markdownlint",
15+
"ms-vscode.powershell",
16+
"streetsidesoftware.code-spell-checker",
17+
"redhat.vscode-yaml"
18+
]
19+
}
20+
},
21+
22+
"settings": {
23+
"terminal.integrated.defaultProfile.linux": "pwsh"
24+
},
25+
26+
"postCreateCommand": "pwsh .devcontainer/post-create.ps1"
27+
}

.devcontainer/post-create.ps1

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# post-create.ps1
2+
3+
Write-Host "Running DevContainer post-create setup..."
4+
5+
# Ensure scripts can run
6+
Set-ExecutionPolicy RemoteSigned -Scope Process -Force
7+
8+
# Install/update PSResourceGet side-by-side
9+
Write-Host "Installing PSResourceGet..."
10+
Install-Module Microsoft.PowerShell.PSResourceGet -Force -AllowClobber
11+
12+
# Install common modules used in this environment
13+
$requiredModules = @(
14+
"Pester",
15+
"Az.Accounts"
16+
)
17+
18+
Write-Host "Installing required modules..."
19+
foreach ($module in $requiredModules) {
20+
Install-Module $module -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber
21+
}
22+
23+
# Validate installation
24+
foreach ($module in $requiredModules) {
25+
if (-not (Get-Module -ListAvailable -Name $module)) {
26+
Write-Warning "Module [$module] did NOT install successfully!"
27+
}
28+
}
29+
30+
# Display installed versions for debugging
31+
Write-Host "Installed module versions:"
32+
33+
Get-Module -ListAvailable |
34+
Where-Object { $_.Name -in $requiredModules + "Microsoft.PowerShell.PSResourceGet" } |
35+
Sort-Object Name, Version |
36+
Format-Table Name, Version, ModuleBase

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
### Security
1919

20+
## 0.31.0 - 2025-12-14
21+
22+
### Added
23+
24+
- Added GitHub Codespaces and DevContainerSupport (Non Functional Change)
25+
- Added function `Update-FabricCapacity`
26+
- Added Error Detailed Info in `Test-FabricApiResponse` (Debug mode) when `response.error` exists
27+
28+
### Changed
29+
30+
- Version of `Microsoft.PowerShell.PSResourceGet` and `Microsoft.PowerShell.PlatyPS` updated
31+
- Replace the repo's configuration approach with PSFramework (move config handling to PSFramework) #85
32+
- Applied `Invoke-FabricRestMethod` to several public cmdlets #85
33+
34+
### Fixed
35+
36+
- Fixed bug in `Update-FabricSemanticModelDefinition` - Uri was incorrect when a platform file exists
37+
- Name of new SQL database will be shown (#169)
38+
- Logging in with a Service Principal does not work (#164)
39+
2040
## 0.30.0 - 2025-07-22
2141

2242
### Added

RequiredModules.psd1

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,16 @@
1313
#}
1414
Assert = "0.9.6"
1515
InvokeBuild = 'latest'
16-
PSScriptAnalyzer = '1.19.1'
16+
PSScriptAnalyzer = '1.24.0'
1717
Pester = 'latest'
1818
ModuleBuilder = 'latest'
1919
ChangelogManagement = 'latest'
2020
Sampler = 'latest'
2121
'Sampler.GitHubTasks' = 'latest'
2222
MarkdownLinkCheck = 'latest'
23-
PSFramework = 'latest'
24-
'Az.Accounts' = '5.0.0'
25-
'Az.Resources' = '6.15.1'
23+
'PSFramework' = 'latest'
24+
'Az.Accounts' = '5.3.0'
25+
'Az.Resources' = '8.1.1'
2626
'MicrosoftPowerBIMgmt' = '1.2.1111'
27-
'Microsoft.PowerShell.PlatyPS' = @{
28-
Version = '1.0.0-rc1'
29-
Parameters = @{
30-
AllowPrerelease = $true
31-
} # TODO: Simply remove after GA
32-
}
27+
'Microsoft.PowerShell.PlatyPS' = 'latest'
3328
}

Resolve-Dependency.psd1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,9 @@
6767
set to $false then PowerShellGet will be used to resolve dependencies.
6868
#>
6969
UsePSResourceGet = $true
70-
PSResourceGetVersion = '1.0.1'
70+
PSResourceGetVersion = '1.1.1'
7171

7272
# PowerShellGet compatibility module only works when using PSResourceGet or ModuleFast.
7373
UsePowerShellGetCompatibilityModule = $true
7474
UsePowerShellGetCompatibilityModuleVersion = '3.0.23-beta23'
7575
}
76-

build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Pester:
103103
# - FunctionalQuality
104104
# - TestQuality
105105
Tag:
106-
CodeCoverageThreshold: 0.30 # 85 # Set to 0 to bypass
106+
CodeCoverageThreshold: 0.10 # 85 # Set to 0 to bypass
107107
#CodeCoverageOutputFile: JaCoCo_$OsShortName.xml
108108
#CodeCoverageOutputFileEncoding: ascii
109109
# Use this if code coverage should be merged from several pipeline test jobs.

docs/en-US/FabricTools.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Retrieves the workloads for a specific capacity.
112112

113113
### [Get-FabricConfig](Get-FabricConfig.md)
114114

115-
Gets the configuration for use with all functions in the PSFabricTools module.
115+
Gets the configuration for use with all functions in the FabricTools module.
116116

117117
### [Get-FabricConnection](Get-FabricConnection.md)
118118

@@ -686,7 +686,7 @@ Retrieves External Data Shares details from a specified Microsoft Fabric.
686686

687687
### [Set-FabricConfig](Set-FabricConfig.md)
688688

689-
Register the configuration for use with all functions in the PSFabricTools module.
689+
Register the configuration for use with all functions in the FabricTools module.
690690

691691
### [Start-FabricDeploymentPipelineStage](Start-FabricDeploymentPipelineStage.md)
692692

@@ -875,4 +875,3 @@ Updates the role assignment for a specific principal in a Fabric workspace.
875875
### [Write-FabricLakehouseTableData](Write-FabricLakehouseTableData.md)
876876

877877
Loads data into a specified table in a Lakehouse within a Fabric workspace.
878-

docs/en-US/Get-FabricConfig.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ title: Get-FabricConfig
1313

1414
## SYNOPSIS
1515

16-
Gets the configuration for use with all functions in the PSFabricTools module.
16+
Gets the configuration for use with all functions in the FabricTools module.
1717

1818
## SYNTAX
1919

@@ -27,21 +27,21 @@ Get-FabricConfig [[-ConfigName] <string>]
2727

2828
## DESCRIPTION
2929

30-
Gets the configuration for use with all functions in the PSFabricTools module.
30+
Gets the configuration for use with all functions in the FabricTools module.
3131

3232
## EXAMPLES
3333

3434
### EXAMPLE 1
3535

36-
Gets all configuration values for the PSFabricTools module and outputs them.
36+
Gets all configuration values for the FabricTools module and outputs them.
3737

3838
```powershell
3939
Get-FabricConfig
4040
```
4141

4242
### EXAMPLE 2
4343

44-
Gets the BaseUrl configuration value for the PSFabricTools module.
44+
Gets the BaseUrl configuration value for the FabricTools module.
4545

4646
```powershell
4747
Get-FabricConfig -ConfigName BaseUrl
@@ -81,4 +81,3 @@ Author: Jess Pomfret
8181
## RELATED LINKS
8282
8383
{{ Fill in the related links here }}
84-

docs/en-US/Set-FabricConfig.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ title: Set-FabricConfig
1313

1414
## SYNOPSIS
1515

16-
Register the configuration for use with all functions in the PSFabricTools module.
16+
Register the configuration for use with all functions in the FabricTools module.
1717

1818
## SYNTAX
1919

@@ -28,21 +28,21 @@ Set-FabricConfig [[-WorkspaceGUID] <guid>] [[-DataWarehouseGUID] <guid>] [[-Base
2828

2929
## DESCRIPTION
3030

31-
Register the configuration for use with all functions in the PSFabricTools module.
31+
Register the configuration for use with all functions in the FabricTools module.
3232

3333
## EXAMPLES
3434

3535
### EXAMPLE 1
3636

37-
Registers the specified Fabric Data Warehouse configuration for use with all functions in the PSFabricTools module.
37+
Registers the specified Fabric Data Warehouse configuration for use with all functions in the FabricTools module.
3838

3939
```powershell
4040
Set-FabricConfig -WorkspaceGUID 'GUID-GUID-GUID-GUID' -DataWarehouseGUID 'GUID-GUID-GUID-GUID'
4141
```
4242

4343
### EXAMPLE 2
4444

45-
Registers the specified Fabric Data Warehouse configuration for use with all functions in the PSFabricTools module, but does not persist the values.
45+
Registers the specified Fabric Data Warehouse configuration for use with all functions in the FabricTools module, but does not persist the values.
4646

4747
```powershell
4848
Set-FabricConfig -WorkspaceGUID 'GUID-GUID-GUID-GUID' -DataWarehouseGUID 'GUID-GUID-GUID-GUID' -SkipPersist
@@ -196,4 +196,3 @@ Author: Jess Pomfret
196196
## RELATED LINKS
197197
198198
{{ Fill in the related links here }}
199-

source/Private/Confirm-TokenState.ps1

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,32 @@ function Confirm-TokenState {
2424
[CmdletBinding()]
2525
param ()
2626

27+
# Refresh the global FabricConfig variable to be backwards compatible
28+
$script:FabricConfig.BaseUrl = Get-PSFConfigValue 'FabricTools.FabricApi.BaseUrl'
29+
2730
Write-Message -Message "Validating token..." -Level Verbose
2831

2932
try {
3033
# Ensure required properties have valid values
31-
if ([string]::IsNullOrWhiteSpace($FabricConfig.TenantId) -or
32-
[string]::IsNullOrWhiteSpace($FabricConfig.TokenExpiresOn)) {
34+
$tenantId = Get-PSFConfigValue FabricTools.FabricApi.TenantId
35+
$tokenExpiresOn = Get-PSFConfigValue FabricTools.FabricSession.TokenExpiresOn
36+
37+
if ([string]::IsNullOrWhiteSpace($tenantId) -or
38+
[string]::IsNullOrWhiteSpace($tokenExpiresOn)) {
3339
Write-Message -Message "Token details are missing. Please run 'Connect-FabricAccount' to configure the session." -Level Error
3440
throw "MissingTokenDetailsException: Token details are missing."
3541
}
3642

3743
# Convert the TokenExpiresOn value to a DateTime object
38-
if ($FabricConfig.TokenExpiresOn.GetType() -eq [datetimeoffset]) {
39-
$tokenExpiryDate = $FabricConfig.TokenExpiresOn
44+
if ($tokenExpiresOn.GetType() -eq [DateTimeOffset]) {
45+
$tokenExpiryDate = $tokenExpiresOn
4046
} else {
41-
$tokenExpiryDate = [datetimeoffset]::Parse($FabricConfig.TokenExpiresOn)
47+
$tokenExpiryDate = [DateTimeOffset]::Parse($tokenExpiresOn)
4248
}
4349

4450
# Check if the token is expired
45-
if ($tokenExpiryDate -le [datetimeoffset]::Now) {
46-
if ($FabricConfig.FeatureFlags.EnableTokenRefresh) {
51+
if ($tokenExpiryDate -le [DateTimeOffset]::Now) {
52+
if (Get-PSFConfigValue -FullName 'FabricTools.FeatureFlags.EnableTokenRefresh') {
4753
Write-Message -Message "Token has expired. Attempting to refresh the token..." -Level Warning
4854
Connect-FabricAccount -reset
4955
} else {

0 commit comments

Comments
 (0)