From 6a71b6c676d4312f7acf29f97bc30ec52ad186b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Sundling?= Date: Fri, 26 Jan 2024 13:38:27 +0100 Subject: [PATCH] Silence output from Set-AzOpsContext (#854) * Silence output from Set-AzOpsContext * Update * Update * Update --------- Co-authored-by: Jesper Fajers --- src/internal/functions/Set-AzOpsContext.ps1 | 2 +- src/tests/integration/Repository.Tests.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal/functions/Set-AzOpsContext.ps1 b/src/internal/functions/Set-AzOpsContext.ps1 index 89af6256..73cb5f56 100644 --- a/src/internal/functions/Set-AzOpsContext.ps1 +++ b/src/internal/functions/Set-AzOpsContext.ps1 @@ -26,7 +26,7 @@ if (-not $ScopeObject.Subscription) { return } if ($context.Subscription.Id -ne $ScopeObject.Subscription) { Write-AzOpsMessage -LogLevel InternalComment -LogString 'Set-AzOpsContext.Change' -LogStringValues $context.Subscription.Name, $ScopeObject.SubscriptionDisplayName, $ScopeObject.Subscription - Set-AzContext -SubscriptionId $scopeObject.Subscription -WhatIf:$false + $null = Set-AzContext -SubscriptionId $scopeObject.Subscription -WhatIf:$false } } } \ No newline at end of file diff --git a/src/tests/integration/Repository.Tests.ps1 b/src/tests/integration/Repository.Tests.ps1 index ec89b013..06bea35d 100644 --- a/src/tests/integration/Repository.Tests.ps1 +++ b/src/tests/integration/Repository.Tests.ps1 @@ -1144,7 +1144,7 @@ Describe "Repository" { $diff3 = New-TimeSpan -Start $createTime.changeTime[1] -End $createTime.changeTime[2] $diff4 = New-TimeSpan -Start $createTime.changeTime[0] -End $createTime.changeTime[3] # Check if time difference is within x seconds - $allowedDiff = '8' + $allowedDiff = '25' if ($diff1.TotalSeconds -le $allowedDiff -and $diff2.TotalSeconds -le $allowedDiff -and $diff3.TotalSeconds -le $allowedDiff -and $diff4.TotalSeconds -ge $allowedDiff) { # Time difference is within x seconds of each other $timeTest = "good"