Skip to content

Commit 523f433

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

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ function Invoke-ListApiTest {
2222
$Response.AllowedTenants = $script:CippAllowedTenantsStorage.Value
2323
$Response.AllowedGroups = $script:CippAllowedGroupsStorage.Value
2424

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+
2537
return ([HttpResponseContext]@{
2638
StatusCode = [HttpStatusCode]::OK
2739
Body = $Response

0 commit comments

Comments
 (0)