Skip to content

Commit

Permalink
Silence output from Set-AzOpsContext (#854)
Browse files Browse the repository at this point in the history
* Silence output from Set-AzOpsContext

* Update

* Update

* Update

---------

Co-authored-by: Jesper Fajers <[email protected]>
  • Loading branch information
bjompen and Jefajers authored Jan 26, 2024
1 parent b73fa79 commit 6a71b6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/internal/functions/Set-AzOpsContext.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
2 changes: 1 addition & 1 deletion src/tests/integration/Repository.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6a71b6c

Please sign in to comment.