Skip to content

Commit 0c93cfb

Browse files
authored
Merge pull request #54 from dataplat/unification-api-and-tokens
Unification api and tokens
2 parents c6e9c34 + 3084bd8 commit 0c93cfb

File tree

217 files changed

+1441
-2751
lines changed

Some content is hidden

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

217 files changed

+1441
-2751
lines changed

.github/copilot-commit-message-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ Capitalize the subject/description line
33
Do not end the subject line with a period
44
Separate the subject from the body with a blank line
55
Use the imperative mood in the subject line
6-
The subject line should be a single sentence with an action word and target with some reasoning add "for Pester Help Tests"
6+
The subject line should be a single sentence with an action word and a target with some reasoning for the change
77
Use the body to explain what and why in a friendly kind manner
88
Say thank you at the end of the message

.github/workflows/pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
if: success() || failure()
6868
Test_Stage_test_windows_core:
6969
name: Windows (PowerShell)
70-
runs-on: windows-2019
70+
runs-on: windows-latest
7171
needs:
7272
- Build_Stage_Package_Module
7373
steps:
@@ -94,7 +94,7 @@ jobs:
9494
if: success() || failure()
9595
Test_Stage_test_windows_ps:
9696
name: Windows (Windows PowerShell)
97-
runs-on: windows-2019
97+
runs-on: windows-latest
9898
needs:
9999
- Build_Stage_Package_Module
100100
steps:

.vscode/settings.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,19 @@
2020
"*.ps1xml": "xml"
2121
},
2222
"cSpell.words": [
23-
"COMPANYNAME",
24-
"ICONURI",
25-
"LICENSEURI",
26-
"PROJECTURI",
27-
"RELEASENOTES",
23+
"Balabuch",
2824
"buildhelpers",
25+
"COMPANYNAME",
2926
"endregion",
3027
"gitversion",
3128
"icontains",
29+
"ICONURI",
3230
"keepachangelog",
31+
"LICENSEURI",
3332
"notin",
33+
"PROJECTURI",
3434
"pscmdlet",
35+
"RELEASENOTES",
3536
"steppable"
3637
],
3738
"[markdown]": {

CHANGELOG.md

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

4343
- Removed unnecessary or duplicate functions (e.g., `Get-AllFabricDatasetRefreshes`, `Get-AllFabricCapacities`).
4444
- Removed obsolete scripts and commented-out configuration paths.
45+
- Removed `Invoke-FabricAPIRequest` and replaced it by `Invoke-FabricRestMethodExtended`
46+
- Removed `Confirm-FabricAuthToken`
47+
- Renamed `Test-TokenExpired` to `Confirm-TokenState` and extended it using `EnableTokenRefresh` Feature Flag
48+
- Removed `Set-FabricApiHeaders` and merged the entire logic to `Connect-FabricAccount`
4549

4650
### Security
4751

CONTRIBUTING.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ The workflow for using this and developing the code is shown below.
3232
Install-Module Microsoft.PowerShell.PSResourceGet -Force
3333
```
3434

35-
3. Develop your updates in the source directory
35+
3. Start a fresh new PowerShell session to avoid anythjing from your current working sessions to interfere with the module development and building. Develop your updates in the source directory.
3636

37-
You should also resolve all dependencies before you start developing. This will ensure that you have all the required modules installed and loaded into your session.
37+
You should also resolve all dependencies before you start developing. This will ensure that you have all the required modules, and only them, installed and loaded into your session.
3838

3939
```PowerShell
4040
.\build.ps1 -ResolveDependency -Tasks noop -UsePSResourceGet
@@ -83,7 +83,11 @@ The workflow for using this and developing the code is shown below.
8383
```PowerShell
8484
./build.ps1 -Tasks build,test
8585
```
86-
8. Once you are ready to submit your changes for review please ensure that you update the `CHANGELOG.md` file with a summary of your changes. This is important as it helps us keep track of what has changed in the module and makes it easier for users to see what has been added or changed.
86+
This will run all the tests in the `tests` folder and output the results to the console. If there are any issues with the code, they will be reported here.
87+
88+
8. It is always a good idea to develop in a brand new clean session and also once you have finished your changes, you should open a new session, build the module and run a few commands to ensure that everything is working as expected. This will help you catch any issues that may have been introduced during development and also make sure that you have not missed any dependancies.
89+
90+
9. Once you are ready to submit your changes for review please ensure that you update the `CHANGELOG.md` file with a summary of your changes. This is important as it helps us keep track of what has changed in the module and makes it easier for users to see what has been added or changed.
8791

8892
You can use the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format for this.
8993

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ Refer to the individual function documentation for detailed usage instructions.
6666

6767
Every now and again the authentication token might time out. Run this to get a new one:
6868
```powershell
69-
Set-FabricAuthToken
69+
Update-FabricToken
7070
```
7171

7272
If you want to change user context run this:
7373
```powershell
74-
Set-FabricAuthToken -reset
74+
Connect-FabricAccount
7575
```
7676

7777

@@ -89,10 +89,14 @@ Contributions to FabricTools are welcome.
8989
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to develop, test and the process for submitting pull requests to us.
9090

9191
## Authors
92+
_(in alphabetical order)_
9293

94+
- **Tiago Balabuch** - *Huge contribution (90% functions)* - [tiagobalabuch](https://github.com/tiagobalabuch)
9395
- **Ioana Bouariu** - *Initial work* - [Jojobit](https://github.com/Jojobit)
9496
- **Frank Geisler** - *Author of RTI functions* - [Frank Geisler](https://github.com/Frank-Geisler)
9597
- **Kamil Nowinski** - *Refactoring, unification, further commands* - [NowinskiK](https://github.com/NowinskiK)
98+
- **Jess Pomfret** - *Automation, great experience with PowerShell* - [jpomfret](https://github.com/jpomfret)
99+
- **Rob Sewell** - *Automation/DevOps, Governance and experience brought from dbatools* - [SQLDBAWithABeard](https://github.com/SQLDBAWithABeard)
96100

97101
See also the list of [contributors](https://github.com/dataplat/FabricTools/contributors) who participated in this project.
98102

@@ -103,4 +107,5 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
103107
## Acknowledgments
104108

105109
- GitHub Copilot and ChatGPT for helping with the documentation
106-
- [**Rui Romano**](https://github.com/RuiRomano) - His work on a [Fabric PowerShell module](https://github.com/RuiRomano/fabricps-pbip) has been included into this module with his permission. Thanks, Rui!
110+
- [**Rui Romano**](https://github.com/RuiRomano) - His work on a [Fabric PowerShell module](https://github.com/microsoft/Analysis-Services/tree/master/pbidevmode/fabricps-pbip) has been included into this module with his permission. Thanks, Rui!
111+
- [**Tiago Balabuch**](https://github.com/tiagobalabuch) and his phenomenal huge work that make this module more robust and very well organised.

RequiredModules.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
'Sampler.GitHubTasks' = 'latest'
2222
MarkdownLinkCheck = 'latest'
2323
PSFramework = 'latest'
24-
'Az.Accounts' = '4.2.0'
25-
'Az.Resources' = '6.15.1'
26-
'MicrosoftPowerBIMgmt' = '1.2.1111'
24+
'Az.Accounts' = '5.0.0'
25+
'Az.Resources' = '6.15.1'
26+
'MicrosoftPowerBIMgmt' = '1.2.1111'
2727
}

build.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Pester:
104104
# - FunctionalQuality
105105
# - TestQuality
106106
Tag:
107-
CodeCoverageThreshold: 0.35 # 85 # Set to 0 to bypass
107+
CodeCoverageThreshold: 0.30 # 85 # Set to 0 to bypass
108108
#CodeCoverageOutputFile: JaCoCo_$OsShortName.xml
109109
#CodeCoverageOutputFileEncoding: ascii
110110
# Use this if code coverage should be merged from several pipeline test jobs.
@@ -157,4 +157,3 @@ ChangelogConfig:
157157
GitConfig:
158158
UserName: Automation Bot
159159
UserEmail: [email protected]
160-

helper/GetFunctionList.ps1

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
1-
$path = ".\FabricTools\public"
1+
$path = ".\source\public"
22
$op = Get-ChildItem -Path $path -Recurse -Filter *.ps1 | Select-Object -ExpandProperty Name | Sort-Object
33
#$op = $op | ForEach-Object { " ""$_""," }
44
$op | Out-File '.\Output\FunctionList-main-public.txt'
55

6-
$path = ".\FabricTools\tiago\public"
7-
$tp = Get-ChildItem -Path $path -Recurse -Filter *.ps1 | Select-Object -ExpandProperty Name | Sort-Object
8-
$tp | Out-File '.\Output\FunctionList-tiago-public.txt'
6+
# Author Table
7+
# This script generates a table of PowerShell script authors from the specified directory.
8+
$authorTable = @{}
9+
$op | ForEach-Object {
10+
$file = $_.FullName
11+
$name = $_.Name
12+
$content = Get-Content $file
13+
$authorLine = $content | Where-Object { $_ -match 'Author:\s*(.+)' } | Select-Object -First 1
14+
if ($authorLine -match 'Author:\s*(.+)') {
15+
$author = $matches[1].Trim()
16+
$authorTable[$name] = $author
17+
} else {
18+
$authorTable[$name] = $null
19+
}
20+
}
21+
$authorTable
922

10-
$common = Compare-Object -ReferenceObject $op -DifferenceObject $tp -IncludeEqual -ExcludeDifferent | Select-Object -ExpandProperty InputObject
11-
$common
12-
$common | Out-File '.\Output\FunctionList-public-collision.txt'
23+
## Not a singular name option for functions (#26)
24+
Get-Command -Module FabricTools |where Name -like '*s'
25+
Get-Command -Module FabricTools|ForEach-Object { $name = $_.Name; $_.Parameters.Values | Where Name -like '*s' | Select @{N='FunctionName';E={$Name}},Name}

source/FabricTools.psd1

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@ ModuleVersion = '0.0.1'
1818
# CompatiblePSEditions = @()
1919

2020
# ID used to uniquely identify this module
21-
GUID = '0ba3e49a-b47e-4beb-8434-5a34ad41ae72'
21+
GUID = 'f2a0f9e6-fab6-41fc-9e1c-0c94ff38f794'
2222

2323
# Author of this module
2424
Author = 'The FabricTools Team'
2525

26-
# Company or vendor of this module
27-
CompanyName = 'fabrictools.io'
26+
CompanyName = 'fabrictools.io'
2827

2928
# Copyright statement for this module
3029
Copyright = 'Copyright (c) 2025 by FabricTools Team'
@@ -56,7 +55,7 @@ PowerShellVersion = '5.1'
5655

5756
# Modules that must be imported into the global environment prior to importing this module
5857
RequiredModules = @(
59-
@{ ModuleName = 'Az.Accounts' ; ModuleVersion = '4.2.0' },
58+
@{ ModuleName = 'Az.Accounts' ; ModuleVersion = '5.0.0' },
6059
@{ ModuleName = 'MicrosoftPowerBIMgmt.Profile' ; ModuleVersion = '1.2.1111' },
6160
@{ ModuleName = 'Az.Resources' ; ModuleVersion = '6.15.1' }
6261
)
@@ -131,10 +130,9 @@ PrivateData = @{
131130
} # End of PrivateData hashtable
132131

133132
# HelpInfo URI of this module
134-
# HelpInfoURI = ''
133+
HelpInfoURI = 'https://www.github.com/dataplat/FabricTools'
135134

136135
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
137136
# DefaultCommandPrefix = ''
138137

139138
}
140-

0 commit comments

Comments
 (0)