Skip to content

Commit 3084bd8

Browse files
committed
Renamed Test-TokenExpired -> Confirm-TokenState and deleted Update-TokenExpired
1 parent 96f67ef commit 3084bd8

File tree

193 files changed

+339
-406
lines changed

Some content is hidden

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

193 files changed

+339
-406
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4343
- Removed unnecessary or duplicate functions (e.g., `Get-AllFabricDatasetRefreshes`, `Get-AllFabricCapacities`).
4444
- Removed obsolete scripts and commented-out configuration paths.
4545
- Removed `Invoke-FabricAPIRequest` and replaced it by `Invoke-FabricRestMethodExtended`
46-
- Removed `Confirm-FabricAuthToken` and extended existing `Test-TokenExpired` using `EnableTokenRefresh` Feature Flag
46+
- Removed `Confirm-FabricAuthToken`
47+
- Renamed `Test-TokenExpired` to `Confirm-TokenState` and extended it using `EnableTokenRefresh` Feature Flag
4748
- Removed `Set-FabricApiHeaders` and merged the entire logic to `Connect-FabricAccount`
4849

4950
### Security
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
Checks if the Fabric token is expired and logs appropriate messages.
44
55
.DESCRIPTION
6-
The `Test-TokenExpired` function checks the expiration status of the Fabric token stored in the `$FabricConfig.TokenExpiresOn` variable.
6+
The `Confirm-TokenState` function checks the expiration status of the Fabric token stored in the `$FabricConfig.TokenExpiresOn` variable.
77
If the token is expired, it logs an error message and provides guidance for refreshing the token.
88
Otherwise, it logs that the token is still valid.
99
1010
.EXAMPLE
11-
Test-TokenExpired
11+
Confirm-TokenState
1212
1313
Checks the token expiration status using session's `$FabricConfig` object.
1414
@@ -20,7 +20,7 @@ Checks the token expiration status using session's `$FabricConfig` object.
2020
.AUTHOR
2121
Tiago Balabuch
2222
#>
23-
function Test-TokenExpired {
23+
function Confirm-TokenState {
2424
[CmdletBinding()]
2525
param ()
2626

source/Public/Capacity/Get-FabricCapacities.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function Get-FabricCapacities {
3434
# Initialize an array to store the results
3535
$res = @()
3636

37-
Test-TokenExpired
37+
Confirm-TokenState
3838

3939
# If a subscription ID is provided
4040
if ($subscriptionID) {
@@ -72,4 +72,3 @@ function Get-FabricCapacities {
7272
# Return the results
7373
return $res
7474
}
75-

source/Public/Capacity/Get-FabricCapacity.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
2424
.NOTES
2525
- Requires `$FabricConfig` global configuration, including `BaseUrl` and `FabricHeaders`.
26-
- Calls `Test-TokenExpired` to ensure token validity before making the API request.
26+
- Calls `Confirm-TokenState` to ensure token validity before making the API request.
2727
2828
Author: Tiago Balabuch
2929
#>
@@ -46,7 +46,7 @@ function Get-FabricCapacity {
4646
}
4747

4848
# Ensure token validity
49-
Test-TokenExpired
49+
Confirm-TokenState
5050

5151
# Construct the API endpoint URL
5252
$apiEndpointURI = "capacities"

source/Public/Capacity/Get-FabricCapacityRefreshables.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The function retrieves the PowerBI access token and makes a GET request to the P
2828
[string]$top = 5
2929
)
3030

31-
Test-TokenExpired
31+
Confirm-TokenState
3232

3333
# Make a GET request to the PowerBI API to retrieve the top refreshable capacities.
3434
# The function returns the 'value' property of the response.

source/Public/Capacity/Get-FabricCapacitySkus.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Retrieves the fabric capacity information for the specified capacity.
3131
[string]$capacity
3232
)
3333

34-
Test-TokenExpired
34+
Confirm-TokenState
3535

3636
#GET https://management.azure.com/subscriptions/548B7FB7-3B2A-4F46-BB02-66473F1FC22C/resourceGroups/TestRG/providers/Microsoft.Fabric/capacities/azsdktest/skus?api-version=2023-11-01
3737
$uri = "$($AzureSession.BaseApiUrl)/subscriptions/$subscriptionID/resourceGroups/$ResourceGroupName/providers/Microsoft.Fabric/capacities/$capacity/skus?api-version=2023-11-01"

source/Public/Capacity/Get-FabricCapacityState.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The function checks if the Azure token is null. If it is, it connects to the Azu
3838
[string]$capacity
3939
)
4040

41-
Test-TokenExpired
41+
Confirm-TokenState
4242

4343
# Define the URL for the GET request.
4444
$getCapacityState = "$($AzureSession.BaseApiUrl)/subscriptions/$subscriptionID/resourceGroups/$resourcegroup/providers/Microsoft.Fabric/capacities/$capacity/?api-version=2022-07-01-preview"

source/Public/Capacity/Get-FabricCapacityTenantOverrides.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The function retrieves the PowerBI access token and makes a GET request to the F
2222
Param (
2323
)
2424

25-
Test-TokenExpired
25+
Confirm-TokenState
2626

2727
# Make a GET request to the Fabric API to retrieve the tenant overrides for all capacities.
2828
# The function returns the response of the GET request.

source/Public/Capacity/Get-FabricCapacityWorkload.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The function retrieves the PowerBI access token and makes a GET request to the P
2828
[string]$capacityID
2929
)
3030

31-
Test-TokenExpired
31+
Confirm-TokenState
3232

3333
# Make a GET request to the PowerBI API to retrieve the workloads for the specified capacity.
3434
# The function returns the 'value' property of the response.

source/Public/Capacity/Resume-FabricCapacity.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The function defines parameters for the subscription ID, resource group, and cap
4040
[string]$capacity
4141
)
4242

43-
Test-TokenExpired
43+
Confirm-TokenState
4444

4545
# Define the URI for the request.
4646
$resumeCapacity = "$($AzureSession.BaseApiUrl)/subscriptions/$subscriptionID/resourceGroups/$resourcegroup/providers/Microsoft.Fabric/capacities/$capacity/resume?api-version=2022-07-01-preview"

0 commit comments

Comments
 (0)