File tree Expand file tree Collapse file tree 3 files changed +40
-14
lines changed Expand file tree Collapse file tree 3 files changed +40
-14
lines changed Original file line number Diff line number Diff line change 1
- $path = " .\FabricTools \public"
1
+ $path = " .\source \public"
2
2
$op = Get-ChildItem - Path $path - Recurse - Filter * .ps1 | Select-Object - ExpandProperty Name | Sort-Object
3
3
# $op = $op | ForEach-Object { " ""$_""," }
4
4
$op | Out-File ' .\Output\FunctionList-main-public.txt'
5
5
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
9
22
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}
Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ Function Invoke-FabricRestMethod {
19
19
. PARAMETER TestTokenExpired
20
20
A switch parameter to test if the Fabric token is expired before making the request. If the token is expired, it will attempt to refresh it.
21
21
22
+ . PARAMETER PowerBIApi
23
+ A switch parameter to indicate that the request should be sent to the Power BI API instead of the Fabric API.
24
+
22
25
. EXAMPLE
23
26
Invoke-FabricRestMethod -uri "/api/resource" -method "GET"
24
27
@@ -47,17 +50,27 @@ Function Invoke-FabricRestMethod {
47
50
[Parameter (Mandatory = $false )]
48
51
$Body ,
49
52
50
- [switch ] $TestTokenExpired
53
+ [switch ] $TestTokenExpired ,
54
+
55
+ [switch ] $PowerBIApi
51
56
)
52
57
53
58
if ($TestTokenExpired ) {
54
59
Test-TokenExpired
55
60
}
56
61
62
+ $baseUrl = $FabricConfig.BaseUrl
63
+ if ($PowerBIApi ) {
64
+ $baseUrl = $PowerBI.BaseApiUrl
65
+ }
66
+
57
67
if ($Uri -notmatch ' ^https?://.*' ) {
58
- $Uri = " {0}/{1}" -f $FabricConfig.BaseUrl , $Uri
68
+ $Uri = " {0}/{1}" -f $baseUrl , $Uri
69
+ if ($PowerBIApi ) {
70
+ Write-Message - Message " PowerBIApi param is ignored when full Uri is provided." - Level Warning
71
+ }
59
72
}
60
- Write-Message - Message " Fabric API Endpoint: $Uri " - Level Verbose
73
+ Write-Message - Message " Target API Endpoint: $Uri " - Level Verbose
61
74
62
75
if ($Body -is [hashtable ]) {
63
76
$Body = $Body | ConvertTo-Json - Depth 10
Original file line number Diff line number Diff line change @@ -44,14 +44,14 @@ The function defines parameters for the workspace ID and workspace object. If th
44
44
}
45
45
46
46
process {
47
- # If the parameter set name is 'WorkspaceId ', retrieve the workspace object.
48
- if ($PSCmdlet.ParameterSetName -eq ' WorkspaceId ' ) {
49
- $workspace = Get-PowerBIWorkspace - Id $WorkspaceId
47
+ # If the parameter set name is 'WorkspaceObject ', retrieve the workspace object.
48
+ if ($PSCmdlet.ParameterSetName -eq ' WorkspaceObject ' ) {
49
+ $WorkspaceId = $Workspace .id
50
50
}
51
51
52
52
# Make a GET request to the PowerBI API to retrieve the users of the workspace.
53
53
# The function returns the 'value' property of the response, which contains the users.
54
- return (Invoke-FabricRestMethod - Method get - uri (" groups/$ ( $workspace .Id ) /users" ) | ConvertFrom-Json ).value
54
+ return (Invoke-FabricRestMethod - Method get - PowerBIApi - uri (" groups/$WorkspaceId /users" )).value
55
55
}
56
56
57
57
}
You can’t perform that action at this time.
0 commit comments