Skip to content

Commit f035280

Browse files
committed
Update Invoke-ListApiTest.ps1
1 parent 523f433 commit f035280

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ListApiTest.ps1

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ function Invoke-ListApiTest {
1818
$EnvironmentVariables | Add-Member -NotePropertyName $_.Name -NotePropertyValue $_.Value
1919
}
2020
$Response.EnvironmentVariables = $EnvironmentVariables
21+
# test Get-AzAccessToken vs Get-CIPPAzAccessToken timing with stopwatch
22+
$Sw = [System.Diagnostics.Stopwatch]::StartNew()
23+
$null = Get-AzAccessToken
24+
$Sw.Stop()
25+
$Timings = @{}
26+
$Timings.GetAzAccessTokenMs = $Sw.Elapsed.TotalMilliseconds
27+
$Sw = [System.Diagnostics.Stopwatch]::StartNew()
28+
$Token = Get-CIPPAzIdentityToken
29+
$Sw.Stop()
30+
$Timings.GetCippAzIdentityTokenMs = $Sw.Elapsed.TotalMilliseconds
31+
$Response.Timings = $Timings
32+
$Response.Jwt = Read-JwtAccessDetails -Token $Token
2133
}
2234
$Response.AllowedTenants = $script:CippAllowedTenantsStorage.Value
2335
$Response.AllowedGroups = $script:CippAllowedGroupsStorage.Value
2436

25-
# test Get-AzAccessToken vs Get-CIPPAzAccessToken timing with stopwatch
26-
$Sw = [System.Diagnostics.Stopwatch]::StartNew()
27-
$null = Get-AzAccessToken
28-
$Sw.Stop()
29-
$Timings = @{}
30-
$Timings.GetAzAccessTokenMs = $Sw.Elapsed.TotalMilliseconds
31-
$Sw = [System.Diagnostics.Stopwatch]::StartNew()
32-
$null = Get-CIPPAzIdentityToken
33-
$Sw.Stop()
34-
$Timings.GetCippAzIdentityTokenMs = $Sw.Elapsed.TotalMilliseconds
35-
$Response.Timings = $Timings
36-
3737
return ([HttpResponseContext]@{
3838
StatusCode = [HttpStatusCode]::OK
3939
Body = $Response

0 commit comments

Comments
 (0)