Skip to content

Commit 42c4d70

Browse files
committed
feat: Update Mock-EnvironmentVariable
Ignore output from the new-item function
1 parent 5220b43 commit 42c4d70

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

foo

Whitespace-only changes.

src/PesterExtensions/Public/Mock-EnvironmentVariable.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function Mock-EnvironmentVariable {
2020
}
2121
}
2222
else {
23-
New-Item -Path $EnvironmentVariable -Value $Value
23+
New-Item -Path $EnvironmentVariable -Value $Value | Out-Null
2424
}
2525
try {
2626
Invoke-Command -ScriptBlock $Fixture
@@ -29,7 +29,7 @@ function Mock-EnvironmentVariable {
2929
catch {
3030
throw $_
3131
}
32-
32+
3333
finally {
3434
if ($OriginalValue) {
3535
Set-Item -Path $EnvironmentVariable -Value $OriginalValue

0 commit comments

Comments
 (0)