Skip to content

Commit 58825f2

Browse files
authored
fix: update checkVcfToken function (#254)
Updated the module's internal `checkVCFToken` function to ensure and expired token can be refresh when using PowerShell 7. Signed-off-by: Ryan Johnson <[email protected]>
1 parent 6b9237f commit 58825f2

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release History
22

3+
## v2.4.1
4+
5+
> Released: 2023-12-15
6+
7+
- Updated the module's internal `checkVCFToken` function to ensure and expired token can be refresh when using PowerShell 7.
8+
39
## v2.4.0
410

511
> Released: 2023-10-02

PowerVCF.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
# Module manifest for module 'PowerVCF'
55
# Generated by: Broadcom
6-
# Generated on: 2023-11-28
6+
# Generated on: 2023-12-15
77

88
@{
99

1010
# Script module or binary module file associated with this manifest.
1111
RootModule = 'PowerVCF.psm1'
1212

1313
# Version number of this module.
14-
ModuleVersion = '2.5.0.1000'
14+
ModuleVersion = '2.4.1.1000'
1515

1616
# Supported PSEditions
1717
# CompatiblePSEditions = @()
@@ -20,7 +20,7 @@ ModuleVersion = '2.5.0.1000'
2020
GUID = '0558cc7e-71a6-4b08-b9be-341d22653128'
2121

2222
# Author of this module
23-
Author = 'VMware'
23+
Author = 'Broadcom'
2424

2525
# Company or vendor of this module
2626
CompanyName = 'Broadcom'

PowerVCF.psm1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4401,6 +4401,7 @@ Function checkVCFToken {
44014401
if ($expiryDetails.timeToExpiry.Hours -eq 0 -and $expiryDetails.timeToExpiry.Minutes -lt 2) {
44024402
Write-Output "API Access Token Expired. Requesting a new access token with current refresh token."
44034403
$headers = @{"Accept" = "application/json" }
4404+
$headers.Add("Content-Type", "application/json")
44044405
$uri = "https://$sddcManager/v1/tokens/access-token/refresh"
44054406
$response = Invoke-RestMethod -Method PATCH -Uri $uri -Headers $headers -Body $refreshToken
44064407
$Global:accessToken = $response

0 commit comments

Comments
 (0)